Please guide me proper that I want to generate a report with multi_tables.
Suppose I have 3 tables like tables whose names are Men, Women,Childs. There three tables data should be listed in a report. When 1st table data is completed a parameter passed from Vb should be printed and so on.
Im just new in using Crystal Reports.... would u give me a snippet of code in accessing the Report Designer Component (RDC). My main platform is VC but i understand VB... my real problem is the query attach to the report (that can be seen in Show SQL).
sample:
select own_ln, own_fn
from
db2inst1.own_names own_names
<db2inst1 is the owner of the table and also owner of the database, we were just given a schema access to use the database and tables as well>
when i run the program <my UserID is ProgI>, a message box saying "ProgI.own_names" is undefined name.... what seems to be the problem? hope u can give me samples that may modify the setting of the report file at runtime or dynamically.
Imports CrystalDecisions.CrystalReports.Engine
'Namespace or type 'Engine' for the Imports 'CrystalDecisions.CrystalReports.Engine' cannot be found.
Imports CrystalDecisions.Shared
'Namespace or type 'Shared' for the Imports 'Imports CrystalDecisions.Shared' cannot be found.
Imports CrystalDecisions.Web.Design
'Namespace or type 'Design' for the Imports 'CrystalDecisions.Web.Design' cannot be found.
Dim rpt As CrystalReport_item
'Type 'CrystalReport_item' is not defined.
rpt = New CrystalReport_item()
'Type 'CrystalReport_item' is not defined.
I have VB.NET Standard Version 2002. Then I bought Crystal Reports Version 9 in order to print reports. (Note that I don't have Visual Studio.NET, so this is not the embeded Crystal Reports in Visual Studio.NET)
First, I install the VB.NET. Second, I install the Crystal Reports. (I just select normal installation, not customize intallation)
After installation, I create and save a Crystal Reports called "CrystalReport_item" using the Crystal Reports software.
I move the "CrystalReport_item.rpt" to the folder of my solution.
Then at the VB.NET software, I click "Project->Add Existing Item...". Then I click the "CrystalReport_item.rpt" and click "Open" in order to add it to the solution.
Then I type the code
"Dim rpt As CrystalReport_item"
in a new form's button1.click.
However, there is a line under the "CrystalReport_item" and there is a yellow box telling that "Type 'CrystalReport_item' is not defined.".
Firstly, I think that I forget to import libraries, then I type the code
"Imports CrystalDecisions.CrystalReports.Engine".
However, there is a line under the "CrystalDecisions.CrystalReports.Engine" and there is a yellow box telling that "Namespace or type 'Engine' for the Imports 'CrystalDecisions.CrystalReports.Engine' cannot be found.".
Can you please tell me what I need to do in order to add the report to my solution and let it print the report?
Please tell me more detailly as I am just a beginner of VB.NET and Crystal Reports 9. Thanks a lot.
I have a strange problem with a report in Crystal 8.0.
This report is used from a MFC application wich creates a temp table with a customized name to allow multiple user access.
So the reports works wonderfully on every kind of PC and every kind of printer settings. And also i have many applications reporting on temporary tables both in VB and VC++, and all these work perfectly.
But I have a single application doing a strange joke on a single PC and a single Printer.
When the user prints on the Epson4000 the printer defaults loading paper from the mail envelopes dish instead of the "A4" paper dish.
But this problem doesn't occour if the report is another one.
Note: all the rpt files I use got the same printer and page settings.
Hi,
I am trying to create a radar chart. Now the radar chart I can draw lines on the sum of a column values. But my requirement is draw the lines depending on another column value. This should translate into multiple lines.
I'm trying to change the currency format of a report at runtime, here is some of the code...
Code:
Private Sub SetReportFormat(crReport As CRPEAuto.Report)
Dim objSections As CRPEAuto.Sections
Dim objSection As CRPEAuto.Section
Dim objReportObjects As CRPEAuto.ReportObjects
Dim objTextBox As CRPEAuto.TextObject
Dim X As Integer
'// Get an object to represent each of the report sections
Set objSections = crReport.Sections
'// Begin loop for each section in the report
For Each objSection In objSections
'// Get an object to represent each of the objects in the report section
Set objReportObjects = objSection.ReportObjects
'// For each individual object in the report objects collection...
For X = 1 To objReportObjects.Count
'// If the object is a text box...
If objReportObjects.Item(X).Kind = crTextObject Then
'// Get an object-reference to the text box...
Set objTextBox = objReportObjects.Item(X)
'// If the text box is a currency field, then change the currency to
'// the new format
If objTextBox.Format = "Currency" Then
objTextBox.Format = GetCurrencyFormat
End If
'// Destroy this within loop...
Set objTextBox = Nothing
End If
Next
Next
'// Clean up
Set objTextBox = Nothing
Set objReportObjects = Nothing
Set objSections = Nothing
End Sub
However, I get a 'Feature Not Enabled' error on the following line...
objTextBox.Format = GetCurrencyFormat
{GetCurrencyFormat is just a function that returns a string - e.g; £#,##0.00;(£#,##0.00)}
Any ideas? I tried to manipulate other propeties of the object but they all generate the same error??
I hope someone can help me with the following problem.
have a SQL-Server table which contains eight string fields with links to pictures which need to be shown on the report. These str255 fields can sound like "//blabla/pic/test1.jpg" and I really need to get them into the report without storing the pic in the database (we talk about 100 of Gigabytes of pictures).
Hi K. Babu and Evryone,I have a problem to pass value to Stored Procedure parameter with crystal report RAS,this case happen when I use "Execute" command on my stored procedure that to control some parameter based on user input, but it shows an error when i Put the parameter in "Order By" clause....
The value for the parameter seems to be empty. this is my code :
Create Procedure RPT_PRint
@OrderBy varchar(50),
@SortOrder varchar(50)
as
exec(' Select
AbsenceCode,
AbsenceName
from Absence_T
order by '+@OrderBy+' '+@SortOrder)
Go
It comes weird, cause when i try to input the value on the crystal report designer it works fine, but when i pass the value from ASP page it won't show the report.....show error message " Syntax error near By"
I want to run a report ( Crystal Report 7.0) from my program
(code in VB 6.0).
But when I click a print button this error msg was appear ;
errMsg "Invalid report file name"
This are code of my program ;
Private Sub cmdPrint_Click()
On Error GoTo EmpPerDeterr
Cr.Action = 1
Cr.Reset
Cr.ReportTitle = "Catatan Aduan Pegawai MPSJ"
Cr.WindowState = crptMaximized
Cr.WindowTitle = "Catatan Aduan Pegawai MPSJ"
Cr.WindowShowGroupTree = True
action property should be at last line of all the cr.{properties}
cr.action = 1
yours friendly,
K.Babu
Originally posted by pianme
hallo...K.Babu..
any idea how to solve my problem, descr as below;
I want to run a report ( Crystal Report 7.0) from my program
(code in VB 6.0).
But when I click a print button this error msg was appear ;
errMsg "Invalid report file name"
This are code of my program ;
Private Sub cmdPrint_Click()
On Error GoTo EmpPerDeterr
Cr.Action = 1
Cr.Reset
Cr.ReportTitle = "Catatan Aduan Pegawai MPSJ"
Cr.WindowState = crptMaximized
Cr.WindowTitle = "Catatan Aduan Pegawai MPSJ"
Cr.WindowShowGroupTree = True
Managed to solve my problem. Certain aspects of Crystal objects are not enabled, you can determine which ones they are by using the Crystal Object browser (CrystalExplorer.exe) located in your /sample/xtreme/browser directory.
You can change the currency format of the report at run-time by calling the SetLocaleInfo API just before the report is opened.
Code:
'// APIs
Private Declare Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA" _
(ByVal Locale As Long, _
ByVal LCType As Long, _
ByVal lpLCData As String, _
ByVal cchData As Long) As Long
Private Declare Function SetLocaleInfo Lib "kernel32" Alias "SetLocaleInfoA" _
(ByVal Locale As Long, _
ByVal LCType As Long, _
ByVal lpLCData As String) As Long
Private Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long
Private Const LOCALE_SCURRENCY As Long = &H14
Private Function GetUserLocaleInfo(ByVal dwLocaleID As Long, _
ByVal dwLCType As Long) As String
On Error GoTo Fail
Dim sReturn As String
Dim nSize As Long
'// call the function passing the Locale type
'// variable to retrieve the required size of
'// the string buffer needed
nSize = GetLocaleInfo(dwLocaleID, _
dwLCType, _
sReturn, _
Len(sReturn))
'// if successful..
If nSize Then
sReturn = Space$(nSize)
nSize = GetLocaleInfo(dwLocaleID, _
dwLCType, _
sReturn, _
Len(sReturn))
If nSize Then
GetUserLocaleInfo = Left$(sReturn, _
nSize - 1)
End If
End If
Exit Function
Fail:
End Function
Private Sub ChangeCurrencyFormat(NewFormat As String)
Dim LCID As Long
Dim lResult As Long
'// Change the currency format in the LOCALE settings
LCID = GetSystemDefaultLCID()
lResult = SetLocaleInfo(LCID, _
LOCALE_SCURRENCY, _
NewFormat)
End Sub
Private Property Get LocaleCurrency() As String
On Error GoTo Fail
Dim LCID As Long
LCID = GetSystemDefaultLCID()
LocaleCurrency = GetUserLocaleInfo(LCID, LOCALE_SCURRENCY)
Exit Property
Fail:
End Property
So, you can query the current setting with the LocaleCurrency property, change to the required setting using ChangeCurrencyFormat with the desired format e.g. ChangeCurrencyFormat("£") or ChangeCurrencyFormat("€"), open your report, then change back to previous currency format.
Any fields in the report defined with 'Use System Default Format' will now pick up the correct currency from Locale!
Hello K.babu and dear friends all around the world! Please help me to solve my problem. I want to format the rounding properties of a field number. For an example, I have this field [smallest_point] and another field number
[ Price ] and I set the rounding properties of field [Price] by this formula (Crystal Syntax) - in Customize number formatting menu :
IF {smallest_point} = 0.0001 THEN
0.0001
ELSE IF {smallest_point} = 0.01 THEN
0.01
ELSE IF {smallest_point} = 1 THEN
1
So why did the report send me this message : "Bad Formula Result" ?
I have to set the decimal number by the smallest_point. Let's say if the smallest point is 0.01, then the rounding must be 0.01 and decimal properties must be 1.00, if smallest point = 0.0001 then the rounding must be 0.0001 and decimal properties must be 1.0000.
How to solve this error ?
Please note that I've changed the Decimal Properties of the field to with this formula :
IF {smallest_point} = 0.0001 THEN
1.0000
ELSE IF {smallest_point} = 0.01 THEN
1.00
ELSE IF {smallest_point} = 1 THEN
1
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.