QRP file information

Discussion forum about all things Report Builder (all versions).
patlee
United States of America
Posts: 8
Joined: 04 Aug 2017, 20:46
Location: Denver USA

QRP file information

Post by patlee » 14 May 2015, 17:23

Is there a tool available which can list the fonts used by a QRP report template? Or, is there any documentation available for the QRP file format?

We recently set up a new server which produces 300+ reports nightly and a font used by one report (one that we've noticed so far) was not available. Windows or Gupta substituted something close but not close enough.

I would like to find out what fonts are specified by the QRP files in order to make sure they are available on our production system.

Thanks,
Pat

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2370
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: QRP file information

Post by Jeff Luther » 16 May 2015, 18:18

Hi Pat: You have basically asked:
How to list the fonts used in a QRP file
That's a good question and I'm surprised -- unless I missed something in looking at one of my reports -- that there isn't a better way. There's no tool that I know that can analyze a QRP file, except ReportBuilder itself. And I looked in RB for my sample QRP to see if there's a place where RB lists the fonts used for that report, and I couldn't find a place.

However, my QRP happens to use "MS Sans Serif" and "Times New Roman" as I found out and I was able to find this in 2 different ways:
1 -- (time-consuming for a large report!) but I see I can click each input item, background text, etc. field in my small report and the drop-down list of fonts in RB's toolbar show the font used.

2 -- I like using a hex editor-type tool like this one: http://www.hexedit.com/
and when I opened this QRP of mine with 2 fonts with Hex Edit, I scrolled down to the bottom of the file and see what appears to be a list -- with an empty space between each listing -- of the font used for (I assume) a particular field item. I've attached an image showing an example of both fonts which are used for my test ws_custs.qrp report. I know these are the only ones as it's a small report and I verified this with my #1 method above for this report.

Granted, neither way is very elegant and I expected RB to have a way to list the fonts used, but didn't find one.
You do not have the required permissions to view the files attached to this post.
Jeff Luther @ PC Design
Palm Springs, California

frevelundfey

Re: QRP file information

Post by frevelundfey » 19 May 2015, 11:30

Hi Pat,
you could use QuickReport (File Include: qckrpt.apl), use the cReport...-ClassLibrary and go over all ReportFields and get the font of each (cReportField.GetFont()).
Regards Thomas

wardies
Great Britain
Posts: 86
Joined: 21 Mar 2017, 10:44
Location: UK

Re: QRP file information

Post by wardies » 19 May 2015, 18:53

I figured this problem would be useful enough that we could do with something similar to check consistency of our own QRP files, so I've put together a LINQPad Command-Line Script that does its best to extract what look like strings from either ASCII or Unicode Report Builder QRP files (tested with Report Builder 4.2 and TD 6.2).

Instructions for use:

First, install LINQPad and add it to your path if you haven't already done so. From a cmd prompt you should be able to type "lprun" and see the help:
Usage: lprun [<options>] <scriptfile> [<script-args>]
...
Then extract QRPFonts.linq from the attached archive to the current folder and use from the command line as follows:

Code: Select all

lprun qrpfonts.linq --help
Parameter help:
--folder path_to_folder: Specify base folder to recursively check for *.QRP files
--ignoreFile path_to_ignore_file: Specify a file containing a list of values to ignore, one on each line
--verbosity 2: Specify a verbosity level from 0 to 2:
0 = just match text (no file names)
1 = file heading when matches + match
2 = file headings + skipped summary + pos/match

Code: Select all

lprun qrpfonts.linq --folder c:\temp\QRPFiles --verbosity 0 > ignoreList.txt
Now, edit ignoreList.txt and ensure it contains only the font values (and other variable names) you wish to ignore.
Times New Roman
Courier New
nTaxValue
strCustomerLine1
etc...
Note that ignoreList.txt will likely also contain some references to report form variables. There's not a lot we can do about that without understanding the report file format better. But by leaving those variable names in the ignore list, we can ensure they won't be flagged up.

Now, finally, run the script again, referencing the ignore file to use and --verbose 1 so that the output informs you which files contain the errant fonts:

Code: Select all

lprun qrpfonts.linq --folder c:\temp\QRPFiles --ignoreFile ignoreList.txt --verbosity 1 --ignore
Found matches in ASCII report file: c:\temp\QRPFiles\ReportWithBadFont.qrp
Curlz MT
For automation, you could redirect console output to a file and ensure that the file is usually empty by checking the file size.

Hope this helps!
You do not have the required permissions to view the files attached to this post.

patlee
United States of America
Posts: 8
Joined: 04 Aug 2017, 20:46
Location: Denver USA

Re: QRP file information

Post by patlee » 19 May 2015, 21:47

Thanks Jeff for looking.

I don't suppose we could see the doc for the QRP format? I imagine I could get myself in all sorts of trouble with that...

Pat

wardies
Great Britain
Posts: 86
Joined: 21 Mar 2017, 10:44
Location: UK

Re: QRP file information

Post by wardies » 20 May 2015, 10:22

frevelundfey wrote:you could use QuickReport (File Include: qckrpt.apl), use the cReport...-ClassLibrary and go over all ReportFields and get the font of each (cReportField.GetFont()).
Yet another thing I never knew we could do in TD! Very nice.

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2370
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: QRP file information

Post by Jeff Luther » 20 May 2015, 20:39

Pat, you asked to:
see the doc for the QRP format
I don't work at Gupta any longer and thus don't have access to the specification or 'doc' as you call it for RB and its QRP files. Not sure I'd ever seen the doc, either, and I started with the original Gupta Tech. back in 1988.
Jeff Luther @ PC Design
Palm Springs, California

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2370
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: QRP file information

Post by Jeff Luther » 20 May 2015, 23:52

Thomas had a good suggestion in his reply to this thread:
you could use QuickReport (File Include: qckrpt.apl)...
I got to thinking about that and decided to figure out how to do it. Sure enough, using the sample QRP included in the attached zip file, and understanding a bit about RB, the QCKRPT.APL's set of classes, and how the report's hierarchy of groups, blocks, lines and fields is organized, I put together a sample test showing how to list the fonts + font sizes used in a QRP. Tested in 5.2 only, but the code shows how to 'dig down' into the details of a QRP file.

I only scratched the surface of what's possible to find out about in a QRP, so depending on what Pat means by "doc" in his question:
I don't suppose we could see the doc for the QRP format?
he might be able to modify this appl. to see those doc details for a given report that he had asked about.
You do not have the required permissions to view the files attached to this post.
Jeff Luther @ PC Design
Palm Springs, California

patlee
United States of America
Posts: 8
Joined: 04 Aug 2017, 20:46
Location: Denver USA

Re: QRP file information

Post by patlee » 21 May 2015, 18:39

Thank you all for all of the suggestions. I'm sure I have exactly what I need now! I never looked at QCKRPT.APL, thanks Thomas and also Jeff for the great demo app.

Pat

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2370
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: QRP file information

Post by Jeff Luther » 24 May 2015, 21:33

You're welcome, Pat. Glad to help!
Jeff Luther @ PC Design
Palm Springs, California

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests