Page 10 of 14
Re: Arctic reports (reporting system - Windows)
Posted: Mon Mar 10, 2014 12:25 pm
by srod
The debug file will display the values of the controls to be displayed. So look out for the problematic control and see what is to be rendered.
It does look like you will have to construct a simple report, one which has the problem, and send it to me as well as giving me access to the database etc.
Definitely a strange one.
**EDIT : you are using the latest versions of nxReport and Pyrex aren't you? I ask because there were some bugs with group totalling which were fixed, but it took me some time to upload the fix. The bugs were not a million miles away from what you are experiencing. The latest version of the core nxReport module is 1.9.2. Something worth checking.
Re: Arctic reports (reporting system - Windows)
Posted: Mon Mar 10, 2014 2:48 pm
by captain_skank
The original report was generated in 1.4.5 but i'm running it with the latest nx report (1.9.2) - will that still cause the totalling issue ??
I found out why some of the values were omitted when totaling up groups - if I use FORMAT in the sql statement then anything over 999.00 includes a comma ( 1,000.00 ) and is excluded from the group total

Re: Arctic reports (reporting system - Windows)
Posted: Mon Mar 10, 2014 2:59 pm
by captain_skank
OK little bit more work on the sql and discovered if i CAST( something AS CHAR) then the report works as it should. YAY
So if i convert the value to a string it works fine. Still not sure why this is the case as other columns in the report work fine ??
I'll go through other reports now and double check everything.
Re: Arctic reports (reporting system - Windows)
Posted: Mon Mar 10, 2014 3:13 pm
by srod
If nxReport is 'forced' to retrieve a field as a string (because it cannot identify the field type) then it will parse the string to decide if it is a numeric quantity. To do this, it checks your locale settings and so comma decimal notation should not be a problem if your locale is set up that way. As I say though, this is for fields whose type cannot readily be determined.
If that problematic field/control is being used as part of group totals, then perhaps a problem still remains with nxReport in that regard because the aforementioned bugs were difficult to fix.
Re: Arctic reports (reporting system - Windows)
Posted: Mon Mar 10, 2014 3:18 pm
by captain_skank
OK, is there any problem with passing values as strings ??
Thanx for all the help with this, I was getting worried All my reports were wrong, but so far just seems to be this one ( fingers crossed ).
Re: Arctic reports (reporting system - Windows)
Posted: Mon Mar 10, 2014 3:21 pm
by srod
If nxReport is informed that a particular field is a string type then it will not parse the string etc. It will only parse it for numeric content if the field type cannot be determined or is a type (e.g. blob) which nxReport does not support. In this regards, strings are fine.
Exporting Pyrex data as nxReport commands
Posted: Wed Mar 12, 2014 2:05 am
by Neil
Hi srod,
I have used Pyrex (which is a fantastic program!!) to create *nxr files.
Rather than shipping *nxr files with my application, I would like to include the nxReport style code in my application.
Is it possible for Pyrex to export the nxReport commands it creates ??
If not, is there another way to incorporate the required code in my application ??
Thanks,
Re: Arctic reports (reporting system - Windows)
Posted: Wed Mar 12, 2014 9:19 am
by srod
Pyrex will not export report creation code no... I never thought of that actually. Might consider that for the next version. At the moment you would have to create the necessary code yourself.
What you can do is use IncludeBinary to embed the .nxr file in your exe and then use the nxReport_CatchReport() function to load up the report etc. This saves you having to ship a separate .nxr file.
Re: Arctic reports (reporting system - Windows)
Posted: Wed Mar 12, 2014 10:10 am
by captain_skank
srod wrote: next version ? ?
Spill

Re: Arctic reports (reporting system - Windows)
Posted: Wed Mar 12, 2014 10:26 am
by Neil
srod wrote:
What you can do is use IncludeBinary to embed the .nxr file in your exe and then use the nxReport_CatchReport() function to load up the report etc. This saves you having to ship a separate .nxr file.
OK Thanks for that - I'll give it a go.
I guess eventually (failing the issue of the next release !!) I may have to work out the relevant nxReport codes as what I eventually want to have is a lot of reports with different sort options and I thought that it would be a lot more efficient if I used a common set of nxReport commands, and then only had to select the required SQL sort command with an "IF" statement.
Does that requirement make sense ??
Is my proposed method/solution the best way of doing this ??
Thanks again,
Re: Arctic reports (reporting system - Windows)
Posted: Wed Mar 12, 2014 6:53 pm
by srod
You can design a report using Pyrex and then your app can easily alter any individual subreport's datasource using the nxReport dll, so there really is no need to create the entire report from code.
Re: Arctic reports (reporting system - Windows)
Posted: Thu Mar 13, 2014 6:38 am
by Neil
srod wrote:
What you can do is use IncludeBinary to embed the .nxr file in your exe and then use the nxReport_CatchReport() function to load up the report etc. This saves you having to ship a separate .nxr file.
What are the arguments for nxReport_CatchReport()
The only mention of this procedure I could find is in "nxReport_ExportedFunctions.txt" but I do not understand the arguments !!
nxReport_CatchReport(mem, length, *ptrObject.LONG)
I assume *ptrObject.LONG is "@report" as per nxReport_LoadReport()
You mention this procedure in the Arctic Help file but I couldn't find an example.
Thanks,
Incorrect link in Arctic Reports help file
Posted: Thu Mar 13, 2014 6:46 am
by Neil
Hi srod,
Are you aware that the link to "Arctic-Reports" in the help file appears to go to here:
http://www.arctic-reports.com/

Re: Arctic reports (reporting system - Windows)
Posted: Thu Mar 13, 2014 7:05 am
by Neil
srod wrote:You can design a report using Pyrex and then your app can easily alter any individual subreport's datasource using the nxReport dll, so there really is no need to create the entire report from code.
Does this only work if I use the IncludeBinary Option ??
I tried this with no luck:
Code: Select all
If nxReport_LoadReport("Grades.nxr", @report) = #nxReport_OKAY
report\SetCurrentSubreportDataSource(#nxReport_SQLITEDATABASE, "LacStat.s3db"+Chr(10)+"SELECT * FROM Grades ORDER BY GradeName")
Thanks,
Re: Arctic reports (reporting system - Windows)
Posted: Thu Mar 13, 2014 10:54 am
by srod
No it will work on any valid report object regardless of how you loaded the report.
Before changing a subreport's datasource you need to set a current subreport with the \UseSubreport() method.
======
Yes the help for the nxReport core module is incomplete. The new version will not suffer such indignities!

The Arctic-Reports domain is no longer valid, you have to go direct :
http://www.purecoder.net/ArcticReports/. Look in the "nxReport_HeaderFile.pbi" file for lists of methods and exported functions.
Code: Select all
If nxReport_CatchReport(?label_ReportStart, ?label_ReportEnd - ?label_ReportStart, @report) = #nxReport_OKAY
...
EndIf
End
DataSection
label_ReportStart:
IncludeBinary "dynamicReport.nxr"
label_ReportEnd:
EndDataSection