Click here to Skip to main content
12,952,443 members (39,274 online)
Rate this:
 
Please Sign up or sign in to vote.
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 26-Dec-12 17:25pm
Comments
Krunal Rohit 26-Dec-12 23:35pm
   
your code?
ankit.agg1984 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());
}
}
ankit.agg1984 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)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,239
CHill60 3,490
Maciej Los 3,083
Jochen Arndt 1,975
ppolymorphe 1,880


Advertise | Privacy | Mobile
Web01 | 2.8.170525.1 | Last Updated 26 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100