Sunday, March 25, 2012
Crystal V9 Range selection
I have installed SP3. whilst in the development environment, I have created a simple report that just lists everything from a single table. This works fine.
I then introduced a range parameter on one of my fields. then go to preview and enter a valid range, but the results still show all records???
Cant believe this is a enuine bug, as it's pretty fundemental. What am I doing wrong?What datatype it is? I tried with date range. It works fine.|||the field type is a character string and the database is an Access 2000 one.
The values are 2 characters like:
LA LB LC LD LE ......and so on.
when I enter a start of LB and and end LD for instane, it returns All|||check ur selection formula.|||I have now removed all parameter fields and will walk you through what I am doing.
I have the field explorer open and have right clicked on the parameter fields and selected new.
this displays a create parameter field dialog box I then enter a value in the name and propting text values leaving value type as string. I change options to range values then press the button set default values. I ensure that the table is correct and then set the browse field with the column from the table that I want to filter on. Then in the left hand pane it displays all values relating to that column. I press the >> button to make all values the default I then set the order to alphabetical ascending i then press ok. it goes back to the previous dialog and I leave allow editing of default values checked and press ok.
My parameter field now exists in the field explorer window under parameters. I drag this to the report header, and press preview I'm them prompted for a start and end of range which I enter, I then press ok, and then I'm returned all values.
???:confused:|||Everythings looks correct.
The last step is, you have to write the record selection formula.
Goto Report menu, select "SelectFourmula" and then "Record..."
This will opens the edit formula window.
Here select your database field and then give in condition which will be suitable for range values and then select ur parameter field.
This looks like
{table.column} in {?parameter}
now save and close this.
Refrsh the report|||Ah....thx the manual doesn't mention the last bit. It works now.
Crystal Syntax Problem
The code is as follows:
if {GetData;1.Complaint} = "" then
formula = True
else
formula = false
end if
Most of the time it works just fine, however on occasion I get the following error:
Error in formula <Object_Visibility>.
if {GetData;1.Complaint} = "" then
Exception Target Site: []N
I am not sure what causes this error. As a note this Report is used in conjuction with Sql Server and a VB.NET application. Any help given is greatly appreciated.Make sure that the condition does not return null value|||It could return a null value. What can I do in the Crystal Report to account for that? Any help given is greatly appreciated.|||Try this
if {GetData;1.Complaint} = "" or isnull({GetData;1.Complaint}) = True then
formula = True
else
formula = false
end if|||It still gave me the same error. Not sure what to do. Any theories?sql
crystal reports XI and VBA
I am using crystal reports created in version XI with Excel(VBA).
i have the following code to display the report..
********************
Private Sub CommandButton2_Click()
Dim rep As New CrystalReport
rep.ReportFileName = "c:\apcg\test\report1.rpt"
CRViewer1.ReportSource = rep
CRViewer1.ViewReport
End Sub
************
But i am facing an error
Runtime error:430 - Class does not support Automation or does not support expected interface..
Could you any one solve this problem..
i knew that the problem is with CRViewer.dll
when i tried to register that file, it failed..
also i am getting an error "Error accessing Registry" when i click references in VB project menu...
Thanks in advance
salaiTry to reinstall CR X1 and see what happens
Crystal reports with java
I am new with Crystal Reports.
I have strange problems.
I created report with parameters and run it from Tomcat.
When i use default parameters window - parameters value which i add don't affect on report result - it uses previous parameters.
If i use custome jsp and add parameters programmatically it's work.
When i try to perform "Search for text" with some text i get:
"ERROR Some parameters are missing values".
If i leave search control empty and perform "Search for text" all work fine - i get parameters window and after this i get report.
Thanks in advance, VitalyWhen assigning value to the parameter make sure you spelled the name correctly and send the proper data that matches to the parameter datatype
Crystal Reports Viewer [2003]
I have a load of crystal reports which have been created previously, and what I'd like to do is print / preview these from my VB.NET application.
Ideally I'd want a form in VB which will list all of the crystal reports in a particular location on my hard drive. Then I'd like to be able to click onto the reports and print / preview them in the Crystal Viewer.
I have found something called Crystal Reports Viewer on the toolbox, but I can only seem to link 1 report to that.
Can anyone help me with this please, or point me in the direction of some documentation which will help me do this?
Thanks,
J.use filedialogbox and set default path to ur local hard drive folder.
whattever file user selects map it to, reportsourse property of crystalreportviewer.
Thursday, March 22, 2012
Crystal Reports in C# - doesnt show data
I'm new to Crystal Reports... using VS 2005 Beta
I need a simple Report from my simple database - one table.
I created a Crystal Reports-Report and used a "Crystal Reports Viewer" in my Winform and everything seems to work.
When my program starts the Report is displayed, the header is displayed but no Detail-Data. That means: My Data isn't displayed.
You might now think: I haven't got any data in my table... But that isn't true, there are 2 datasets in my table...
What should I do?
Is there any Initializing that i haven't done? Why doesn't the Report showing my data automatically?
Thanks for help!
ITSEOpen the database Do verify Database
Uncheck the option "Save Data with Reports"|||Thanks for your answer !
Open the Database with which Program?
In VS 2005 there is the Tool "DataSources" for the Project-DataSources and at the tool for generating CrystalReports there is the "FieldExplorer".
But in none of them is a checkbox "Save Data ..."
Can you please explain where the checkbox is?
Thanks,
cya|||Open the database Do verify Database
Uncheck the option "Save Data with Reports"
I mean open that report and do that not the database|||ok ;-) then I should open the Report. I open it with VS and where is the checkbox? I looked in every dialog I can find, but I think you are using a other program?|||Well
Through coding give
CR.DiscardSavedData=True|||ok I wan't to try it.
In my Project I only got a WinForm, a CrystalReportViewer in it and a CrystalReport. (a "crystalReport1.rpt" File)
Where should I write the "DiscardSavedData"-Thing? I tried to find this Attribute in my classes but couldn't find it.
I know it looks like I'm stupid, but can you or someone show me in which File in which Class I should write your code?
Thanks... Please give me more input not only a simple "one-line" answer... it's really annoying that my Report doesn't work.
To overcome that problem I had to use an Access-Database, create a Access-Report and it worked... It could be sooooo simple...
But why o why... I think I begin to hate the programmers of crystalReports...!!!!
Hope somebody helps me out of this ****.
Thanks
Tuesday, March 20, 2012
Crystal Reports and Databinding
is there any kind of possibility to bind the fields in a Crystal reports on an self created object or its class description? I can not bind the report fields on a database, so I would like to bind an ArrayList or something like that to the report.
It is possible? If yes, where can I find stuff about how to do it?Can you explain with more details?
Do you want to send array list and want to display them?|||Yes, I have different typed collections and want to show objects inside of it.|||Then use parameter and send that value to it|||Seems that it is what I want. Is there any kind of possiblity to use mapping names like in datasets or do I have to make the mapping by hand?
Any tutorials or samples would be helpful.
Monday, March 19, 2012
Crystal Report XI with Excel(VBA).
I am using crystal reports created in version XI with Excel(VBA).
i have the following code to display the report..
********************
Private Sub CommandButton2_Click()
Dim rep As New CrystalReport
rep.ReportFileName = "c:\apcg\test\report1.rpt"
CRViewer1.ReportSource = rep
CRViewer1.ViewReport
End Sub
************
But i am facing an error
Runtime error:430 - Class does not support Automation or does not support expected interface..
Could you any one solve this problem..
i knew that the problem is with CRViewer.dll
when i tried to register that file, it failed..
also i am getting an error "Error accessing Registry" when i click references in VB project menu...
Thanks in advance
salaiTry to reinstall CR and see what happens
Crystal Report using SQL CE
I've created an app that connects to a SQLCE database. I need to create Crystal Reports that connect to the database. There is no ODBC driver for SQLCE. How can I do this?
Thanks,
Kathy
Can you use OLEDB with Crystal Reports, the provider name is:
PROVIDER=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0
|||Erik, I'm missing something along the way.
I've ran C:\WINDOWS\system32\regsvr32.exe sqlceoledb30.dll but don't see sqlserver mobile 3.0 under the OLEDB connections I can define in Crystal. I've also tried sending the connection through code and get the following error. Public member 'DataSourceConnections' on type 'Crystal Report Class'
Errors at
rpt.DataSourceConnections.Item(0).SetConnection("", "" & path1 & "\sales_quote.sdf", False)
Code:
Dim rpt As New Quote " name of report
Private Sub loadreport(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim path1 As String = My.Application.Info.DirectoryPath '' path
Dim con As New OleDbConnection("Provider=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0;Data Source=|DataDirectory|\sales_quote.sdf")
Dim com As New OleDbCommand(" SELECT Quote_Header.Quote_Num, CUSTOMER.sh_name, CUSTOMER.sh_street," & _
"FROM ((Quote_Header Quote_Header INNER JOIN Quote_Line Quote_Line ON " & _
"Quote_Header.Quote_Num=Quote_Line.MQUOTE_NUM) LEFT OUTER JOIN SALESMAN SALESMAN ON Quote_Header.Salesman=SALESMAN.sm_salenum)" & _
"LEFT OUTER JOIN CUSTOMER CUSTOMER ON Quote_Header.ShipNum=CUSTOMER.sh_shipnum " & _
"WHERE Quote_Header.Quote_Num='" & 18 - 2209 - 7 & "' ORDER BY Quote_Line.QUOTE_AREA")
com.CommandType = CommandType.Text '' command type
com.Connection = con '' give connection to command
Dim adp As New OleDbDataAdapter '' declare adapter
adp.SelectCommand = com '' select command for adpapter to work on
Dim ds As New DataSet '' delcare dataset
adp.Fill(ds, "sales_quote") '' fill the dataset through adapter
Try
rpt.DataSourceConnections.Item(0).SetConnection("", "" & path1 & "\sales_quote.sdf", False)
'rpt.DataSourceConnections.Item(0).SetLogon("admin", "")
Catch exp As Exception
MsgBox(exp.Message)
End Try
rpt.DataSource = ds '' select the Dataset to the source of the report
CRViewer1.ReportSource = rpt '' assign the report to the crytal reprot viewr (cr1)
Can you tell me how to set the connection through Crystal Reports set database location or what I'm missing in my code.
Thanks,
|||I don't understand the purpose of this line of code:
rpt.DataSourceConnections.Item(0).SetConnection
You already have filled a dataset (ds), and set this dataset to the datasource of the report.
Excuse my Crystal ignorance....
|||I want to create a report with crystal report 9 and my database is sql server ce on pocket pc. How I connect to tables on sql server ce inside crystal report? I install sql server 2005 on my pc but there is'nt any provider in crystal report 9 that I can connect to tables on sql server ce. please help me.thank you
|||i have the same prob to connect to SQL CE with CR11 ,the sqlceoledb30.dll is not realized by CR11
|||Please contact Crystal support with this issue.
|||Has anyone found out how to do this? Any replies from Crystal?
I've been looking around the net and haven't found any info on how to use Crystal with sql ce.
|||In case anyone's still looking, I finally got around this by using XML data definitions. A good example can be found here:
http://www.vbdotnetheaven.com/UploadFile/krishnajina/CrystalReportwithXmlInVB11102005001552AM/CrystalReportwithXmlInVB.aspx
Crystal Report using SQL CE
I've created an app that connects to a SQLCE database. I need to create Crystal Reports that connect to the database. There is no ODBC driver for SQLCE. How can I do this?
Thanks,
Kathy
Can you use OLEDB with Crystal Reports, the provider name is:
PROVIDER=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0
|||
Erik, I'm missing something along the way.
I've ran C:\WINDOWS\system32\regsvr32.exe sqlceoledb30.dll but don't see sqlserver mobile 3.0 under the OLEDB connections I can define in Crystal. I've also tried sending the connection through code and get the following error. Public member 'DataSourceConnections' on type 'Crystal Report Class'
Errors at
rpt.DataSourceConnections.Item(0).SetConnection("", "" & path1 & "\sales_quote.sdf", False)
Code:
Dim rpt As New Quote " name of report
Private Sub loadreport(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim path1 As String = My.Application.Info.DirectoryPath '' path
Dim con As New OleDbConnection("Provider=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0;Data Source=|DataDirectory|\sales_quote.sdf")
Dim com As New OleDbCommand(" SELECT Quote_Header.Quote_Num, CUSTOMER.sh_name, CUSTOMER.sh_street," & _
"FROM ((Quote_Header Quote_Header INNER JOIN Quote_Line Quote_Line ON " & _
"Quote_Header.Quote_Num=Quote_Line.MQUOTE_NUM) LEFT OUTER JOIN SALESMAN SALESMAN ON Quote_Header.Salesman=SALESMAN.sm_salenum)" & _
"LEFT OUTER JOIN CUSTOMER CUSTOMER ON Quote_Header.ShipNum=CUSTOMER.sh_shipnum " & _
"WHERE Quote_Header.Quote_Num='" & 18 - 2209 - 7 & "' ORDER BY Quote_Line.QUOTE_AREA")
com.CommandType = CommandType.Text '' command type
com.Connection = con '' give connection to command
Dim adp As New OleDbDataAdapter '' declare adapter
adp.SelectCommand = com '' select command for adpapter to work on
Dim ds As New DataSet '' delcare dataset
adp.Fill(ds, "sales_quote") '' fill the dataset through adapter
Try
rpt.DataSourceConnections.Item(0).SetConnection("", "" & path1 & "\sales_quote.sdf", False)
'rpt.DataSourceConnections.Item(0).SetLogon("admin", "")
Catch exp As Exception
MsgBox(exp.Message)
End Try
rpt.DataSource = ds '' select the Dataset to the source of the report
CRViewer1.ReportSource = rpt '' assign the report to the crytal reprot viewr (cr1)
Can you tell me how to set the connection through Crystal Reports set database location or what I'm missing in my code.
Thanks,
|||I don't understand the purpose of this line of code:
rpt.DataSourceConnections.Item(0).SetConnection
You already have filled a dataset (ds), and set this dataset to the datasource of the report.
Excuse my Crystal ignorance....
|||
I want to create a report with crystal report 9 and my database is sql server ce on pocket pc. How I connect to tables on sql server ce inside crystal report? I install sql server 2005 on my pc but there is'nt any provider in crystal report 9 that I can connect to tables on sql server ce. please help me.thank you
|||i have the same prob to connect to SQL CE with CR11 ,the sqlceoledb30.dll is not realized by CR11
|||Please contact Crystal support with this issue.
|||Has anyone found out how to do this? Any replies from Crystal?
I've been looking around the net and haven't found any info on how to use Crystal with sql ce.
|||
In case anyone's still looking, I finally got around this by using XML data definitions. A good example can be found here:
http://www.vbdotnetheaven.com/UploadFile/krishnajina/CrystalReportwithXmlInVB11102005001552AM/CrystalReportwithXmlInVB.aspx
Crystal Report using SQL CE
I've created an app that connects to a SQLCE database. I need to create Crystal Reports that connect to the database. There is no ODBC driver for SQLCE. How can I do this?
Thanks,
Kathy
Can you use OLEDB with Crystal Reports, the provider name is:
PROVIDER=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0
|||
Erik, I'm missing something along the way.
I've ran C:\WINDOWS\system32\regsvr32.exe sqlceoledb30.dll but don't see sqlserver mobile 3.0 under the OLEDB connections I can define in Crystal. I've also tried sending the connection through code and get the following error. Public member 'DataSourceConnections' on type 'Crystal Report Class'
Errors at
rpt.DataSourceConnections.Item(0).SetConnection("", "" & path1 & "\sales_quote.sdf", False)
Code:
Dim rpt As New Quote " name of report
Private Sub loadreport(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim path1 As String = My.Application.Info.DirectoryPath '' path
Dim con As New OleDbConnection("Provider=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0;Data Source=|DataDirectory|\sales_quote.sdf")
Dim com As New OleDbCommand(" SELECT Quote_Header.Quote_Num, CUSTOMER.sh_name, CUSTOMER.sh_street," & _
"FROM ((Quote_Header Quote_Header INNER JOIN Quote_Line Quote_Line ON " & _
"Quote_Header.Quote_Num=Quote_Line.MQUOTE_NUM) LEFT OUTER JOIN SALESMAN SALESMAN ON Quote_Header.Salesman=SALESMAN.sm_salenum)" & _
"LEFT OUTER JOIN CUSTOMER CUSTOMER ON Quote_Header.ShipNum=CUSTOMER.sh_shipnum " & _
"WHERE Quote_Header.Quote_Num='" & 18 - 2209 - 7 & "' ORDER BY Quote_Line.QUOTE_AREA")
com.CommandType = CommandType.Text '' command type
com.Connection = con '' give connection to command
Dim adp As New OleDbDataAdapter '' declare adapter
adp.SelectCommand = com '' select command for adpapter to work on
Dim ds As New DataSet '' delcare dataset
adp.Fill(ds, "sales_quote") '' fill the dataset through adapter
Try
rpt.DataSourceConnections.Item(0).SetConnection("", "" & path1 & "\sales_quote.sdf", False)
'rpt.DataSourceConnections.Item(0).SetLogon("admin", "")
Catch exp As Exception
MsgBox(exp.Message)
End Try
rpt.DataSource = ds '' select the Dataset to the source of the report
CRViewer1.ReportSource = rpt '' assign the report to the crytal reprot viewr (cr1)
Can you tell me how to set the connection through Crystal Reports set database location or what I'm missing in my code.
Thanks,
|||I don't understand the purpose of this line of code:
rpt.DataSourceConnections.Item(0).SetConnection
You already have filled a dataset (ds), and set this dataset to the datasource of the report.
Excuse my Crystal ignorance....
|||
I want to create a report with crystal report 9 and my database is sql server ce on pocket pc. How I connect to tables on sql server ce inside crystal report? I install sql server 2005 on my pc but there is'nt any provider in crystal report 9 that I can connect to tables on sql server ce. please help me.thank you
|||i have the same prob to connect to SQL CE with CR11 ,the sqlceoledb30.dll is not realized by CR11
|||Please contact Crystal support with this issue.
|||Has anyone found out how to do this? Any replies from Crystal?
I've been looking around the net and haven't found any info on how to use Crystal with sql ce.
|||
In case anyone's still looking, I finally got around this by using XML data definitions. A good example can be found here:
http://www.vbdotnetheaven.com/UploadFile/krishnajina/CrystalReportwithXmlInVB11102005001552AM/CrystalReportwithXmlInVB.aspx
Crystal Report using SQL CE
I've created an app that connects to a SQLCE database. I need to create Crystal Reports that connect to the database. There is no ODBC driver for SQLCE. How can I do this?
Thanks,
Kathy
Can you use OLEDB with Crystal Reports, the provider name is:
PROVIDER=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0
|||Erik, I'm missing something along the way.
I've ran C:\WINDOWS\system32\regsvr32.exe sqlceoledb30.dll but don't see sqlserver mobile 3.0 under the OLEDB connections I can define in Crystal. I've also tried sending the connection through code and get the following error. Public member 'DataSourceConnections' on type 'Crystal Report Class'
Errors at
rpt.DataSourceConnections.Item(0).SetConnection("", "" & path1 & "\sales_quote.sdf", False)
Code:
Dim rpt As New Quote " name of report
Private Sub loadreport(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim path1 As String = My.Application.Info.DirectoryPath '' path
Dim con As New OleDbConnection("Provider=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0;Data Source=|DataDirectory|\sales_quote.sdf")
Dim com As New OleDbCommand(" SELECT Quote_Header.Quote_Num, CUSTOMER.sh_name, CUSTOMER.sh_street," & _
"FROM ((Quote_Header Quote_Header INNER JOIN Quote_Line Quote_Line ON " & _
"Quote_Header.Quote_Num=Quote_Line.MQUOTE_NUM) LEFT OUTER JOIN SALESMAN SALESMAN ON Quote_Header.Salesman=SALESMAN.sm_salenum)" & _
"LEFT OUTER JOIN CUSTOMER CUSTOMER ON Quote_Header.ShipNum=CUSTOMER.sh_shipnum " & _
"WHERE Quote_Header.Quote_Num='" & 18 - 2209 - 7 & "' ORDER BY Quote_Line.QUOTE_AREA")
com.CommandType = CommandType.Text '' command type
com.Connection = con '' give connection to command
Dim adp As New OleDbDataAdapter '' declare adapter
adp.SelectCommand = com '' select command for adpapter to work on
Dim ds As New DataSet '' delcare dataset
adp.Fill(ds, "sales_quote") '' fill the dataset through adapter
Try
rpt.DataSourceConnections.Item(0).SetConnection("", "" & path1 & "\sales_quote.sdf", False)
'rpt.DataSourceConnections.Item(0).SetLogon("admin", "")
Catch exp As Exception
MsgBox(exp.Message)
End Try
rpt.DataSource = ds '' select the Dataset to the source of the report
CRViewer1.ReportSource = rpt '' assign the report to the crytal reprot viewr (cr1)
Can you tell me how to set the connection through Crystal Reports set database location or what I'm missing in my code.
Thanks,
|||I don't understand the purpose of this line of code:
rpt.DataSourceConnections.Item(0).SetConnection
You already have filled a dataset (ds), and set this dataset to the datasource of the report.
Excuse my Crystal ignorance....
|||I want to create a report with crystal report 9 and my database is sql server ce on pocket pc. How I connect to tables on sql server ce inside crystal report? I install sql server 2005 on my pc but there is'nt any provider in crystal report 9 that I can connect to tables on sql server ce. please help me.thank you
|||i have the same prob to connect to SQL CE with CR11 ,the sqlceoledb30.dll is not realized by CR11
|||Please contact Crystal support with this issue.
|||Has anyone found out how to do this? Any replies from Crystal?
I've been looking around the net and haven't found any info on how to use Crystal with sql ce.
|||In case anyone's still looking, I finally got around this by using XML data definitions. A good example can be found here:
http://www.vbdotnetheaven.com/UploadFile/krishnajina/CrystalReportwithXmlInVB11102005001552AM/CrystalReportwithXmlInVB.aspx
Crystal Report using SQL CE
I've created an app that connects to a SQLCE database. I need to create Crystal Reports that connect to the database. There is no ODBC driver for SQLCE. How can I do this?
Thanks,
Kathy
Can you use OLEDB with Crystal Reports, the provider name is:
PROVIDER=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0
|||Erik, I'm missing something along the way.
I've ran C:\WINDOWS\system32\regsvr32.exe sqlceoledb30.dll but don't see sqlserver mobile 3.0 under the OLEDB connections I can define in Crystal. I've also tried sending the connection through code and get the following error. Public member 'DataSourceConnections' on type 'Crystal Report Class'
Errors at
rpt.DataSourceConnections.Item(0).SetConnection("", "" & path1 & "\sales_quote.sdf", False)
Code:
Dim rpt As New Quote " name of report
Private Sub loadreport(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim path1 As String = My.Application.Info.DirectoryPath '' path
Dim con As New OleDbConnection("Provider=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0;Data Source=|DataDirectory|\sales_quote.sdf")
Dim com As New OleDbCommand(" SELECT Quote_Header.Quote_Num, CUSTOMER.sh_name, CUSTOMER.sh_street," & _
"FROM ((Quote_Header Quote_Header INNER JOIN Quote_Line Quote_Line ON " & _
"Quote_Header.Quote_Num=Quote_Line.MQUOTE_NUM) LEFT OUTER JOIN SALESMAN SALESMAN ON Quote_Header.Salesman=SALESMAN.sm_salenum)" & _
"LEFT OUTER JOIN CUSTOMER CUSTOMER ON Quote_Header.ShipNum=CUSTOMER.sh_shipnum " & _
"WHERE Quote_Header.Quote_Num='" & 18 - 2209 - 7 & "' ORDER BY Quote_Line.QUOTE_AREA")
com.CommandType = CommandType.Text '' command type
com.Connection = con '' give connection to command
Dim adp As New OleDbDataAdapter '' declare adapter
adp.SelectCommand = com '' select command for adpapter to work on
Dim ds As New DataSet '' delcare dataset
adp.Fill(ds, "sales_quote") '' fill the dataset through adapter
Try
rpt.DataSourceConnections.Item(0).SetConnection("", "" & path1 & "\sales_quote.sdf", False)
'rpt.DataSourceConnections.Item(0).SetLogon("admin", "")
Catch exp As Exception
MsgBox(exp.Message)
End Try
rpt.DataSource = ds '' select the Dataset to the source of the report
CRViewer1.ReportSource = rpt '' assign the report to the crytal reprot viewr (cr1)
Can you tell me how to set the connection through Crystal Reports set database location or what I'm missing in my code.
Thanks,
|||I don't understand the purpose of this line of code:
rpt.DataSourceConnections.Item(0).SetConnection
You already have filled a dataset (ds), and set this dataset to the datasource of the report.
Excuse my Crystal ignorance....
|||I want to create a report with crystal report 9 and my database is sql server ce on pocket pc. How I connect to tables on sql server ce inside crystal report? I install sql server 2005 on my pc but there is'nt any provider in crystal report 9 that I can connect to tables on sql server ce. please help me.thank you
|||i have the same prob to connect to SQL CE with CR11 ,the sqlceoledb30.dll is not realized by CR11
|||Please contact Crystal support with this issue.
|||Has anyone found out how to do this? Any replies from Crystal?
I've been looking around the net and haven't found any info on how to use Crystal with sql ce.
|||In case anyone's still looking, I finally got around this by using XML data definitions. A good example can be found here:
http://www.vbdotnetheaven.com/UploadFile/krishnajina/CrystalReportwithXmlInVB11102005001552AM/CrystalReportwithXmlInVB.aspx
Crystal Report using SQL CE
I've created an app that connects to a SQLCE database. I need to create Crystal Reports that connect to the database. There is no ODBC driver for SQLCE. How can I do this?
Thanks,
Kathy
Can you use OLEDB with Crystal Reports, the provider name is:
PROVIDER=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0
|||Erik, I'm missing something along the way.
I've ran C:\WINDOWS\system32\regsvr32.exe sqlceoledb30.dll but don't see sqlserver mobile 3.0 under the OLEDB connections I can define in Crystal. I've also tried sending the connection through code and get the following error. Public member 'DataSourceConnections' on type 'Crystal Report Class'
Errors at
rpt.DataSourceConnections.Item(0).SetConnection("", "" & path1 & "\sales_quote.sdf", False)
Code:
Dim rpt As New Quote " name of report
Private Sub loadreport(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim path1 As String = My.Application.Info.DirectoryPath '' path
Dim con As New OleDbConnection("Provider=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0;Data Source=|DataDirectory|\sales_quote.sdf")
Dim com As New OleDbCommand(" SELECT Quote_Header.Quote_Num, CUSTOMER.sh_name, CUSTOMER.sh_street," & _
"FROM ((Quote_Header Quote_Header INNER JOIN Quote_Line Quote_Line ON " & _
"Quote_Header.Quote_Num=Quote_Line.MQUOTE_NUM) LEFT OUTER JOIN SALESMAN SALESMAN ON Quote_Header.Salesman=SALESMAN.sm_salenum)" & _
"LEFT OUTER JOIN CUSTOMER CUSTOMER ON Quote_Header.ShipNum=CUSTOMER.sh_shipnum " & _
"WHERE Quote_Header.Quote_Num='" & 18 - 2209 - 7 & "' ORDER BY Quote_Line.QUOTE_AREA")
com.CommandType = CommandType.Text '' command type
com.Connection = con '' give connection to command
Dim adp As New OleDbDataAdapter '' declare adapter
adp.SelectCommand = com '' select command for adpapter to work on
Dim ds As New DataSet '' delcare dataset
adp.Fill(ds, "sales_quote") '' fill the dataset through adapter
Try
rpt.DataSourceConnections.Item(0).SetConnection("", "" & path1 & "\sales_quote.sdf", False)
'rpt.DataSourceConnections.Item(0).SetLogon("admin", "")
Catch exp As Exception
MsgBox(exp.Message)
End Try
rpt.DataSource = ds '' select the Dataset to the source of the report
CRViewer1.ReportSource = rpt '' assign the report to the crytal reprot viewr (cr1)
Can you tell me how to set the connection through Crystal Reports set database location or what I'm missing in my code.
Thanks,
|||I don't understand the purpose of this line of code:
rpt.DataSourceConnections.Item(0).SetConnection
You already have filled a dataset (ds), and set this dataset to the datasource of the report.
Excuse my Crystal ignorance....
|||I want to create a report with crystal report 9 and my database is sql server ce on pocket pc. How I connect to tables on sql server ce inside crystal report? I install sql server 2005 on my pc but there is'nt any provider in crystal report 9 that I can connect to tables on sql server ce. please help me.thank you
|||i have the same prob to connect to SQL CE with CR11 ,the sqlceoledb30.dll is not realized by CR11
|||Please contact Crystal support with this issue.
|||Has anyone found out how to do this? Any replies from Crystal?
I've been looking around the net and haven't found any info on how to use Crystal with sql ce.
|||In case anyone's still looking, I finally got around this by using XML data definitions. A good example can be found here:
http://www.vbdotnetheaven.com/UploadFile/krishnajina/CrystalReportwithXmlInVB11102005001552AM/CrystalReportwithXmlInVB.aspx
Crystal Report sub-report expert advice needed.
I created 2 seperate Crystal reports and each report performs its own calculations.
However, I need to multiply the output of Report 1 with the output of Report 2.
I created a new Crystal report and inserted Report 1 and Report 2 as sub-report 1 and sub-report 2 in my new Crystal report. The output of both sub-report 1 and sub-report 2 are numeric.
I need to find out how I can multiply the output of sub-report 1 and sub-report 2 so that the total is displayed on my main Crystal report.
Any help will be much appreciated.Sorry, I don't remember how exactly to do it but I am sure Crystal Report help has an answer to this. But why don't you do all calculations on the backend using stored procedure or a view and return ready to display result then using cumbersome and slow report facilities?
Sunday, March 11, 2012
Crystal Report in VB.net Why Server Login?
Thanks,
CathyI've noticed that a report will ask for a database log-in, even if it was saved with data, and isn't automatically refreshed, if the database that the report was connected to when it was created, is not "locatable". I noticed this because when working at home, I would be prompted, and at work, I would not be. If I changed the data source (at home), it would no longer prompt for log-in info.|||I am at work and I'm not prompted when I connect to the same data for my forms...only with Crystal...
Thanks,
Cathy|||Cathy,
Don't know if this might apply in your situation, but, the thread "How to load a database name at runtime" http://www.dev-archive.com/forum/showthread.php?t=288950, shows people providing the log-in info just before the reports are opened, by coding it into the program. That doesn't really answer why, but it sounds like a workaround.
john
crystal report failed after installed
I've created an application using VB to manipulate data from SQL servers and getting help from Crystal Reports too.
After I finished, I deployed it as usual, and it did, to a computer without VB & Crystal Report. But when I tried to run on the target PC it always returns error when I choose to view a report from crystal report form that I've created. (I tested on my other report view which directly from SQL to VB without Crystal Report, and it runs perfectly)
Please, tell me what is going on, is it because of the Windows version that causing these errors? (I savd my work with XP but deploy them in a Win98 PC)
Thanks.What's the error message that you're getting? Did you make sure you deployed all the dll's that you needed along with all the dependencies?
If you give a little more info about how you use Crystal with VB, it will help us to be able to help you better.
Thursday, March 8, 2012
Crystal Report 10
Now I have available Cristal Reports 10 and I'd like modifying these .rpt files.
I open 8.5 rpt file with CR10 and I save it without modifying it.
I can see .rpt file dimension is reduced about 50% and running report by using the particular software it gets an error : unable to load report.
Is it necessary conversion from 10 rpt file to 8.5 file ?
How can I use CR10 to modify 8.5 rpt file ?You need to update your software as well. It uses the runtime version of 8.5, which is unable to read version 10 reports, and now that you edit your reports these are saved using version 10 format (you saw the decrease in size). The version 10 developer can only be used to save reports in version 10 format. The runtime engine for verion 10 can however also read version 8.5 reports.
- Jukka
Crystal Report (using stored procedures - parameter passing)
Dim myCMD As New SqlCommand("select_all_infor", myConn)
myCMD.CommandType = CommandType.StoredProcedure
Dim parr As New SqlClient.SqlParameter("@.Pid", SqlDbType.Int)
parr.Direction = ParameterDirection.Input
parr.Value = TextBox1.Text
myCommand.Parameters.Add(parr)
myCommand.Parameters.Add("@.Pid", TextBox1.Text)
Dim myDA As New SqlDataAdapter
myDA.SelectCommand = myCMD
Dim myDS As New myDS
myDA.Fill(myDS)
Dim myRPT As New fromSP_REPORT
myRPT.SetDataSource(myDS)
CrystalReportViewer1.ReportSource = myRPT
this is what i've written. Im not sure about connecting to a dataset. Pls correct me.
it's giving this error:
Procedure 'select_all_infor' expects parameter '@.Pid', which was not supplied.try to use this.
crReportDocument.SetParameterValue(0,(object) "first parameter");
crReportDocument.SetParameterValue(1,(object) "second parameter");
Wednesday, March 7, 2012
Crystal Report - Map Field
I had designed the crystal reports with the SQL command as the data source. Now I have created views with the same command with some modifications. I use the "Set DataSource Location" to change the data source to the created view. When i click update, I get the Map Dialog.
I'm fine with all these things. My problem is, if i had left some fields unmapped and saved the report, I'm unable to map further.Also I'm not able to change my mapping later. How to go about it? Is there a way to change the mappings?
Regards,
- KulanthaivelDo verify Database that will show the mappings if any