Click here to Skip to main content
15,894,291 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

My data, It's not displaying in crystal report,when i use AttachDbFileName=|DataDirectory|\Abc.mdf in app.config.

I am using .\SQLEXPRESS with AttachDbFileName=|DataDirectory|\Abc.mdf in app.config.
It's showing error of Logon Failed with only crystal report.

Every thing is perfect, but i having problem with crystal report only.

Please help me.

Thanks in Advance.
Ankit Agarwal
Software Engineer
Posted
Comments
[no name] 26-Dec-12 23:35pm    
your code?
[no name] 26-Dec-12 23:43pm    
<add key="ConnString1" value="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ABC.mdf;Database=GodrejInterio;Integrated Security=True">

it's my coonection string.

I am exporting crystal report to pdf,but my database's data it's not display in pdf, I have design crystal report with datasource.

SQPDF cr = new SQPDF();\\ SQPDF it's my crystal report name.

public void ExportToPdf()
{
try
{

cr.SetDatabaseLogon("", "", @".\SQLEXPRESS", "ABC");
ExportOptions CrExportOptions;
DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions CrFormatTypeOption = new PdfRtfWordFormatOptions();
CrDiskFileDestinationOptions.DiskFileName = "C:\\"+CustomerDetails+".pdf";
CrExportOptions = cr.ExportOptions;
{
CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
CrExportOptions.ExportDestinationOptions = CrDiskFileDestinationOptions;
CrExportOptions.ExportFormatOptions = CrFormatTypeOption;
}
cr.Export();
MessageBox.Show("Your Data Successfully Export");
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
[no name] 27-Dec-12 0:55am    
hello,

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900