is there anybody with working Crystal Report and SQLite? any info would be great. SQLite is one of the fastest database in world but somehow there is no examples how to connect those two.
I don't need any rhetorical answers..i need real code..to get started with.
Or maybe you can tell me other solutions to replace CR with.
EDIT: For those who new to this like i'm. All you need to do is Add new dataset as in screenshot, create table with the same name that will be used in this report, add the same fields as will be used in report. Then with Database Expert add this dataset, add fields to report and they will appear :)
here is how i run in C# netikslumai1 is CrystalReportDocument, darbineLenta is my string variable with database name. DataSet1 is COMPONENT not that dataset we added like in screenshot.
netikslumai1.Load(Application.StartupPath + "\\netikslumai.rpt");
netikslumai1.SetDataSource(dataSet1.Tables[darbineLenta]);
crystalReportViewer1.ReportSource = netikslumai1;
crystalReportViewer1.Refresh();
You cannot directly locate your SQLite Database, from Database Expert in a crystal Report. To connect the SQLite and the Crystal Report, at first you need to create a system DSN to your database. For this
Control Panel
--> Administrative Tools
--> Data Sources(ODBC)
--> System DSN
--> Create New by clicking Add
--> Select SQLite ODBC Driver
--> Give a custom name for DSN and
--> Now browse and select your database.
In the Crystal Report you can find this DSN you have created in
Create New Connection
--> ODBC (RDO)
--> Select the DSN
. If you locate the DSN then all the tables from your database will be automatically added to your crystal Report. Hope it will help you, Happy coding.
EDIT:
First add one dataset control to your project of type dataset1.xsd and fill all the values of the database to the dataset. Then by going through Database Expert --> Project Data --> ADO .Net datasets
select and display in your report.
You can create a dataset object with the same fields you want to display in the report, use exactly the same field names. Design your report using this dataset object. Finally populate the report in the code using your SQLite db.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With