Hi All,
I have created one Outlook addin using VSTO / Office 2007 / VB 2005
(with VS 2005 SP1).
I have created one .Net dll in which I have created a crystal report.
On clicking a button in custom form, I am calling the function in .Net
dll to create a
report. I took following steps to create a report using dataset.
1> Create a new crystal report -> Using the Report Wizard -> Standard -
> Create New Connection -> Database Files
2> Here I choose the xml (say, c:\ReportRecords.xml ) file that should
I use as the report's datasource.
3> Choose the tables from xml file, filter records, group records etc
& finally create a report.
4> Following is my code snippet to create a report & dynamically set
the datasource to dataset.
******************************************************************************************************************************************
' Create one xml document say, xmlDoc, programmatically which is the
same as the datasource of crystalReport1.rpt
.....
.....
' After document is generated create a dataset from that document
Dim nodeReader As New XmlNodeReader(xmlDoc)
Dim settings As New XmlReaderSettings()
Dim myXMLReader As Xml.XmlReader
myXMLReader = XmlReader.Create(nodeReader, settings)
' Create a Dataset
Dim ds As New DataSet
ds.ReadXml(myXMLReader)
' Instance of form on which I am having ReportViewer control.
Dim frm As New dlgReportViewer
Dim myReport As New CrystalReport1()
' Set the datasource of report to newly created ds
myReport.SetDataSource(ds)
frm.ReportViewer.ReportSource = myReport
******************************************************************************************************************************************
I am always getting exception at the line "myReport.SetDataSource
(ds)" when I call this function from outlook custom form and the
exception says
"Unknown Query Engine Error
Error in File <temp folder path>\temp_d8c08404-
ff70-4857-9145-97772cc9e8eb {C88D8F59-C709-4E8E-
B35E-6B107DCA7239}.rpt:
Unknown Query Engine Error". I can run other functions in .net dll
through custom form without any problem, but only in this function,
specifically while
setting the datasource, I am getting exceptions.
I set the permissions of crystal report directory to FullTrust also
but the same problem happens again.
Note that if I call this function from any other project than outlook
Addin, it works! I created a windows exe project & added the reference
to the dll &
call the function to generate the report. It works perfectly!
Please help me to solve this problem.
Thanks in advance,
Dhananjay