How can I make a dummy data item???

demi222
Member Posts: 131
I need on almost all of my reports to have vertical lines all the time printed...to show columns.
How can I make the lines always be printed...even if a record is not printed?
I think I somehow need to count how many lines there are, and something like that, but I truely have no idea..
Can anyone help? 8-[
How can I make the lines always be printed...even if a record is not printed?
I think I somehow need to count how many lines there are, and something like that, but I truely have no idea..
Can anyone help? 8-[
0
Comments
-
First of all... DO NOT DO THIS!!!!
Second of all... STILL DO NOT DO THIS!!!
Final option:
First you will need to know howmany line you can print on a page. Let's say this is 22 lines.
The you will need to count the line you already have printed. So code a counter in the already existing dataitems. Say you printed 12 lines.
You will need to make a "filler" dataitem that loops 10 times.
Create an "Integer" dataitem and filter it's number field in the OnPreDataItem like so :SETRANGE(Number,NumbOfRecsPrinted,MaxNumbOfRecsOnPage)
Print your columns in the body of this dataitem.
Now test is... It could be you will need to print a line less to lose the "newpage" feature....
Good Luck"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
ok, I will try.
Thank you 8-[0 -
This is for example for my report 206...
records are printed in Sales Invoice Line Body section.
I added a dummy data item after Sales Invoice Line Data Item.
On Pre Data item of Sales Invoice Line I wrote:
Counters := 0;
MaxNum := 22;
On After Get Record f Sales Invoice Line I wrote:
Counters := Counters + 1;
MaxNum := MaxNum - Counters;
On Pre Data Item of my Dummy I wrote:
SETRANGE(Number,Counters, MaxNum);
I added lines in my dummy section and nothing printed out.
My sales invoice line also has a footer section... I want the lines to end before the footer section. My dummy section, however, comes after the sales invoice line bodies and footers. So, how can it add lines, if it is after?
Please help me.. thank you0 -
Dude!
First.....
On Pre Data item of Sales Invoice Line I wrote:
Counters := 0;
MaxNum := 22;
On After Get Record f Sales Invoice Line I wrote:
Counters := Counters + 1;
MaxNum := MaxNum - Counters;
1st loop: Counter = 1, MaxNum = 22 - 1 (21)
2nd loop : Counter = 2, MaxNum = 21 - 2 (19)
3rd loop : Counter = 3, MaxNum = 19 - 3 (16)
4th loop : Counter = 4, MaxNum = 16 - 4 (12)
ect...
Do you see what is going wrong there? Two more lines, and your MaxNum is 0.
Just make a counter, that's it. Name it NumRecsPrinted instead of Counter. Counter could be anything, you need variable names that make sence!
When finished printing your lines you will see the number of lines you print will be in the NumRecsPrinted variable.
Then your Integer loop is needed. In the OnPre set a filter:SETRANGE(Number,NumRecsPrinted,<The max. Lines you can print on a page*>)
* 22 was only an example. You can probably not print more then 10 on a header lines report like an invoice or order.
Is this a bit more clear?"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
ok, so I made my SETRANGE(Number, PrintedLines,10); it prints lines.
HOWEVER> the problem is here:
records are printed in Sales Invoice Line Body section.
I added a dummy data item after Sales Invoice Line Data Item.
I added lines in my dummy section and they printed out below the footer section of the Sales Invoice Line Footer...
I don't want them below... I want the lines printed in the body of the Sales Invoice Line section...
do you understand me now?0 -
Sure, it's not like you are typing chinees
No problem! Just keep it the way it is, and move the the things you are printing in the line footer to a new dataitem (integer)."Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
ok, I'll try.. :?
I really appreciate your help0 -
lemme know how it turns out!"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
this is what is happening now..
I added the integer and it looks good if nothing is printed but the lines.
I wrote IF CurrReport.PAGENO < 2 THEN
SETRANGE(Integer,1,(14 - PrintedLines));
I have two body sections and then the dummy integer section.
in the first section I have 3 text boxes, which I have drawn lines next to each text box so that each time a record is printed, so is a line. I also have lines in my dummy integer section.
If 2 rows are printed then it goes to the next page and starts printing lines there... on top of having the lines already from the dummy section, it takes them from the actual records too...
I can't do this for some reason... it's just not working!!0 -
You will need to reset the counter when you switch to a new page or maybe I can figure out something better...
Maybe you should do somethinglike this.
If you would print 50 lines in total and only 20 lines per page fit. Then you could calculate the number of lines left on the next page like so:
50 mod 20 = 10.
So. NumRecsPrinted mod MaxRecsOnPage = LinesToFill
SETRANGE(Number, NumRecsPrinted mod 20, 20)
You should test this, i'm not sure you this works in all posible cases. What happens if NumRecsPrinted is 20 or less forinstance..."Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
it's still not working right...
I don't know...0 -
Sup?"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
does anyone have a one page or multi page report that also prints out lines?
Please send to my e-mail so that I can see what I am doing wrong...
Or if anyone can help..
I appreciate it0 -
I'll make you one this weekend!!
But you need to do me one favour, read the link below to know what!
Keep you eye on the forum!"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
Dude!
I finished a sample....
Should be :SETRANGE(Nummer, 1, MaxNumbOfLinesPerPage - (NumOfLinesPrinted MOD MaxNumbOfLinesPerPage));
Gimme that mail address and i'll send the sample to you!!"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
Still got that sample for you!
Hopefully I didn't make it for nothing..."Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions