Arctic reports (reporting system - Windows)

Developed or developing a new product in PureBasic? Tell the world about it.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Arctic reports (reporting system - Windows)

Post 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.
I may look like a mule, but I'm not a complete ass.
User avatar
captain_skank
Enthusiast
Enthusiast
Posts: 639
Joined: Fri Oct 06, 2006 3:57 pm
Location: England

Re: Arctic reports (reporting system - Windows)

Post 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 :)
User avatar
captain_skank
Enthusiast
Enthusiast
Posts: 639
Joined: Fri Oct 06, 2006 3:57 pm
Location: England

Re: Arctic reports (reporting system - Windows)

Post 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 :lol:

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.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Arctic reports (reporting system - Windows)

Post 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.
I may look like a mule, but I'm not a complete ass.
User avatar
captain_skank
Enthusiast
Enthusiast
Posts: 639
Joined: Fri Oct 06, 2006 3:57 pm
Location: England

Re: Arctic reports (reporting system - Windows)

Post 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 ).
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Arctic reports (reporting system - Windows)

Post 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.
I may look like a mule, but I'm not a complete ass.
Neil
Enthusiast
Enthusiast
Posts: 198
Joined: Wed Feb 29, 2012 8:04 am
Location: Melbourne, AUS

Exporting Pyrex data as nxReport commands

Post 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,
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Arctic reports (reporting system - Windows)

Post 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.
I may look like a mule, but I'm not a complete ass.
User avatar
captain_skank
Enthusiast
Enthusiast
Posts: 639
Joined: Fri Oct 06, 2006 3:57 pm
Location: England

Re: Arctic reports (reporting system - Windows)

Post by captain_skank »

srod wrote: next version ? ?
Spill :)
Neil
Enthusiast
Enthusiast
Posts: 198
Joined: Wed Feb 29, 2012 8:04 am
Location: Melbourne, AUS

Re: Arctic reports (reporting system - Windows)

Post 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,
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Arctic reports (reporting system - Windows)

Post 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.
I may look like a mule, but I'm not a complete ass.
Neil
Enthusiast
Enthusiast
Posts: 198
Joined: Wed Feb 29, 2012 8:04 am
Location: Melbourne, AUS

Re: Arctic reports (reporting system - Windows)

Post 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,
Last edited by Neil on Thu Mar 13, 2014 9:03 am, edited 1 time in total.
Neil
Enthusiast
Enthusiast
Posts: 198
Joined: Wed Feb 29, 2012 8:04 am
Location: Melbourne, AUS

Incorrect link in Arctic Reports help file

Post 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/

Image
Neil
Enthusiast
Enthusiast
Posts: 198
Joined: Wed Feb 29, 2012 8:04 am
Location: Melbourne, AUS

Re: Arctic reports (reporting system - Windows)

Post 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,
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Arctic reports (reporting system - Windows)

Post 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
I may look like a mule, but I'm not a complete ass.
Post Reply