0
votes

I have a complicated SQL in Excel to generate a raw data table for report from SQL server OLEDB . I would like to use Crystal Report to generate a neat and formatted report. I can use the Excel raw data table as the Crystal report database data source. But, Excel need to be refreshed every time new report is required. How can I use the Excel SQL command text string to be Crystal Report data source?

My Excel connect string: Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=MicrosoftDynamicsAX;Data Source=SQL2;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=RD04;Use Encryption for Data=False;Tag with column collation when possible=False

I have Crystal report version 8.5 and 11.

1
what do you mean by excel to be refreshed? - Siva
Because Excel data is from SQL Server and get by SQLOLEDB query. - YellowLarry
Maybe I should use the other way to ask question. How can I use SQL Server query on the Crystal report? The query is complicated and it is not easy to create by Crystal Report from scratch. How can I copy the exist query and paste it to Crystal report sql? - YellowLarry

1 Answers

1
votes

Its simple

While creating the connection dont select tables instead use add command and then paste the query in the box and use in reports