Hi guys,
We have created a multiple columns report to print labels. The report has 2 columns, the normal behaviors is to print first the left column and then start with the other column. I would like to implement print by row instead by column as I mention below, please check the item "expected behavior", is it possible to do?
Example: consider the page is an A4 containing a maximum of 8 labels available to be printed.
The data fetched from DB will be using 6 label only because there is no more records.
x => column 1
y => column 2
- => blank
Default behavior
x y
x y
x -
x -
Summary: 6 elements will be printed, 2 elements in blank
Expected behavior
x y
x y
x y
- -
Summary:6 elements will be printed, 2 elements in blank
Suggestions are welcome, maybe this is a limitation and there is nothing we can do to solve this issue.
Thanks and regards,
Ezekiel
Behavior Multiple columns in a report
Behavior Multiple columns in a report
Last edited by Anonymous on 28 Dec 2016, 20:11, edited 3 times in total.
Re: Behavior Multiple columns in a report
I don't think so, yet. A possibility might be that the data are wrong. Maybe... because a columnar report for labels should print out each pair (x,y) of values that are defined in the Detail Block. This Block would look like:maybe this is a limitation... [?]
X_ITEM | Y_ITEM (2 separate fields on the same Block line)
as 2 fields of the 2 input items, right? Then the data coming in should be:
x y
x y
x y
<blank>,<blank>
It looks like the data are coming in as:
x y
x y
x <blank>
x <blank>
Is there also a off-by-one bug that an extra blank row/label is printed in your "Expected behavior"? Normally I would think that the apt should return FALSE from the SAM_ReportFetchNext msg as soon as there were no more data to print. (Though maybe a blank last label is what you want?)
Here is what I suggest: Write a small test case (apt + qrp) where the data (x,y; x,y; x,y; <blank>,<blank>) are hard-coded in the apt and your qrp is simply this 2-column report you expect. ZIP the apt + qrp, attach it to a reply to this forum msg. thread and let us look at it.
I often recommend writing a small test case -- even if only for your own testing -- to work out an issue like this to understand why, in this case, the "Default behavior" (I guess you mean, "Current behavior") is not what you expect and what you want.
Jeff Luther @ PC Design
Palm Springs, California
Palm Springs, California
Re: Behavior Multiple columns in a report
Thanks Jeff for you answer.
The current behavior is complete the first column and then continue with the second column.
The current behavior is complete the first column and then continue with the second column.
Re: Behavior Multiple columns in a report
I remember RB being called a "banded" report writer. That is, it prints everything across a line, then advances to the next line and prints everything on that line, etc. RB isn't designed to print all lines of 1 column, then 'go back up to the top' and print all lines in the second column.The current behavior is complete the first column and then continue with the second column.
As I said, you will need to write a small test case for this to see if it (somehow) can be done. Again, it looks like the data are not coming in correctly.
Jeff Luther @ PC Design
Palm Springs, California
Palm Springs, California
Re: Behavior Multiple columns in a report
I solved it by software, reading data three at a time (my report was three columns) and passing it to the report.
QRP attached.
!!CB!! 173
On SAM_ReportFetchNext
Set n=1
If nRet=44
Set nRet=1
Return FALSE
While n<=3
Call SqlFetchNext( hSqlMain, nRet )
If nRet=FETCH_EOF
Set nRet=44
Set n=4
Select Case n
Case 1
Set c_articolo1=c_articolo
Set d_articolo1=d_articolo
Set c_misura1=c_misura
Set d_taglia1=d_taglia
Set d_colore1=d_colore
Break
Case 2
Set c_articolo2=c_articolo
Set d_articolo2=d_articolo
Set c_misura2=c_misura
Set d_taglia2=d_taglia
Set d_colore2=d_colore
Break
Case 3
Set c_articolo3=c_articolo
Set d_articolo3=d_articolo
Set c_misura3=c_misura
Set d_taglia3=d_taglia
Set d_colore3=d_colore
Break
Set n=n+1
Return TRUE
QRP attached.
!!CB!! 173
On SAM_ReportFetchNext
Set n=1
If nRet=44
Set nRet=1
Return FALSE
While n<=3
Call SqlFetchNext( hSqlMain, nRet )
If nRet=FETCH_EOF
Set nRet=44
Set n=4
Select Case n
Case 1
Set c_articolo1=c_articolo
Set d_articolo1=d_articolo
Set c_misura1=c_misura
Set d_taglia1=d_taglia
Set d_colore1=d_colore
Break
Case 2
Set c_articolo2=c_articolo
Set d_articolo2=d_articolo
Set c_misura2=c_misura
Set d_taglia2=d_taglia
Set d_colore2=d_colore
Break
Case 3
Set c_articolo3=c_articolo
Set d_articolo3=d_articolo
Set c_misura3=c_misura
Set d_taglia3=d_taglia
Set d_colore3=d_colore
Break
Set n=n+1
Return TRUE
Re: Behavior Multiple columns in a report
Gigit -- When you paste code in like you did in your last reply, it's better to select all that text and then click the 'Code' button above this edit field. That way the indenting/formatting is retained. I'll do that with your text. Note that is kind of a guess as to where the 'If' statements are, which is why indenting the code is better in the first place. Also, there's no QRP attached to your reply.
Code: Select all
!!CB!! 173
On SAM_ReportFetchNext
Set n=1
If nRet=44
Set nRet=1
Return FALSE
While n<=3
Call SqlFetchNext( hSqlMain, nRet )
If nRet=FETCH_EOF
Set nRet=44
Set n=4
Select Case n
Case 1
Set c_articolo1=c_articolo
Set d_articolo1=d_articolo
Set c_misura1=c_misura
Set d_taglia1=d_taglia
Set d_colore1=d_colore
Break
Case 2
Set c_articolo2=c_articolo
Set d_articolo2=d_articolo
Set c_misura2=c_misura
Set d_taglia2=d_taglia
Set d_colore2=d_colore
Break
Case 3
Set c_articolo3=c_articolo
Set d_articolo3=d_articolo
Set c_misura3=c_misura
Set d_taglia3=d_taglia
Set d_colore3=d_colore
Break
Set n=n+1
Return TRUE
Jeff Luther @ PC Design
Palm Springs, California
Palm Springs, California
Re: Behavior Multiple columns in a report
Thanks, Jeff, for the hint.
I attached the QRP twice. May be i did something wrong. I'll try again.
ah. I got a message: "The extension qrp is not allowed."
Here the link
https://drive.google.com/open?id=0B2aZp ... zNuRHNzWHM
I attached the QRP twice. May be i did something wrong. I'll try again.
ah. I got a message: "The extension qrp is not allowed."
Here the link
https://drive.google.com/open?id=0B2aZp ... zNuRHNzWHM
Who is online
Users browsing this forum: [Ccbot] and 2 guests