Page 1 of 3

Need An excel report file sample

Posted: Fri Sep 07, 2012 6:15 am
by memethemyn
Hi..

I need a sample project to create excel reports from my project.. I searched the forum but I didint find:(
Now I am trying to make report by using help file..

Thanks already..

Mehmet..

Re: Need An excel report file sample

Posted: Fri Sep 07, 2012 7:48 am
by mark.monroe
The sample project called "Sample_Report" contains a sample report.
Snap 2012-09-07 at 07.46.36.jpg
Snap 2012-09-07 at 07.46.36.jpg (25 KiB) Viewed 18268 times

Re: Need An excel report file sample

Posted: Wed Sep 12, 2012 4:36 am
by memethemyn
Dear Mark...

During to day you helped me very times..
but now I have some trouble with reports.. For example I have an database named database.sdf

I have a datalogger named Datalogger1

and I have an item named LogItem1

so I prepare an excel file which includes the SQL queries but when I want to generate report the projects gives me error.. Please help me about this trouble..

Thanks Already..

Re: Need An excel report file sample

Posted: Wed Sep 12, 2012 10:58 am
by mark.monroe
You need to do the following steps, which are included in the Developers Manual and help file in iX Developer. Also make sure that you have permissions to write to the folder you are saving the generated report to. If you do not have those permissions that the report will not be written and iX will also not error.

I have attached a working report from the sample project you sent me.

Present the Database Data in the Report
The data retrieved from the SQLdatabase, using the queries in the configuration sheet, can be presented in the report using “named ranges” in Microsoft Excel.
A named range is created in Microsoft Excel by following these steps:
1. Select the cells to be included in a named range.
2. Click the Define name command from the Insert menu. (In Excel 2007, go
to the Formulas tab and choose Name Manager).
3. Enter a name for the range. Thenamemust be enteredinthe following
format:
“__QueryName__”.
Replace “QueryName” with the name that you have chosen for yourSQL
query.
To present the data in the report, enter the following syntax into the cells included
in the named range:
<#QueryName.DatabaseColumnName>
Replace the “DatabaseColumnName” entry with the actual name of the table in the SQLdatabase that you wish to present in the report.

Re: Need An excel report file sample

Posted: Fri Oct 19, 2012 3:31 am
by wlederer
Sorry, could not find where and how to put path of the *.xls file?
I want it to be saved on SD-card or USB memory.
Regards, Waldemar

Re: Need An excel report file sample

Posted: Fri Oct 19, 2012 7:59 am
by mark.monroe
Snap 2012-10-19 at 07.58.41.png
Snap 2012-10-19 at 07.58.41.png (112.89 KiB) Viewed 18123 times

Re: Need An excel report file sample

Posted: Mon Oct 22, 2012 2:04 am
by wlederer
Thank You Mark.
I put a button " Refresh" on the screen with DatabaseViewer1 and chose click action:
void Refresh_btn_Click(System.Object sender, System.EventArgs e)
{
DatabaseViewer1.DatabaseName="database.sdf";
DatabaseViewer1.DataTableName="DataLogger1";
DatabaseViewer1.ShowData();
}
When the "Refresh" button is clicked the data are shown on the screen.
Second button "Report" was put on the screen and an action "Generate report" was attached.

It did record a file to SD card, but with an error message:
ERROR: Missing Closing Tag on formula: "<#UVquery.DataLogger1"
Whar does it mean?
Regards, Waldemar Lederer

Re: Need An excel report file sample

Posted: Mon Oct 22, 2012 8:31 am
by mark.monroe
It means your formula is wrong and is missing a closing tag. Take a look at the example report and check your formulas. From what you copied and pasted it looks like you need to add a ">" at the end.

Re: Need An excel report file sample

Posted: Tue Oct 23, 2012 4:32 am
by wlederer
Thank You Mark for help. Still no success.
In the manual (iX Developer_MAEN831G_English.pdf, page 322) is written:

Enter theSQLqueries in the following format:
SQL(DatabaseName;SQLquery)
Example: SQL(General; SELECT* FROMDataLogger1)
There are two available databases: General and AuditTrail.

But, after running DatabaseViewer1 I could not find them. Click on “Browse Database” got two different databases: database.sdf and NonVolatileDatabase.sdf. Is there a mistake in the manual, or I looked in the wrong place?
Regards, Waldemar

Re: Need An excel report file sample

Posted: Tue Oct 23, 2012 7:45 am
by mark.monroe
The database you want is under "MyProject\Temp\Output\database.sdf". You also need to look at page 323 of the manual. You can not just enter the "<>" query in a cell, you need to do it using the insert menu otherwise Excel does not understand that it is a query that should be executed.

From page 323:

Present the Database Data in the Report:
The data retrieved from the SQLdatabase, using the queries inthe configuration sheet, can be presented in the report using “named ranges” in Microsoft Excel. A named range is created inMicrosoft Excel by following these steps:

1. Select the cells to be included in a named range.

2. Click the Define name command from the Insert menu. (In Excel 2007, go
to the Formulas tab and choose NameManager).

3. Enter a name for the range. Thenamemust be enteredinthe following
format:

“__QueryName__”.
Replace “QueryName” with the name that you have chosen for yourSQL
query. To present the data in the report, enter the following syntax into the cells included in the named range:
<#QueryName.DatabaseColumnName>
Replace the “DatabaseColumnName” entry with the actual name of the table in
the SQLdatabase that youwish to present in the report.