hi,
Does anybody have an idea about how to write a general report generator module?
Right now, I can create a report file by coding the specific position on a page. codes like following:
print_textbox(File, Page, 100, 100, 200, 300, "Hello");
It means It prints the string "Hello" at the location starts from (100, 100) to(200,300).
So, If I want to print the text at another location, I have to change the numberic data one by one. That is repeated work.
Does it have any solution for it to reduce the times of modifying numberic data?
Thanks
2 1110 Banfa 9,065
Expert Mod 8TB
Not without more information. I think you description of what you already have is too limited, you presumably don't just print "hello" each time. Post a larger section of pseudo code.
In general if you have to change a output you are always going to have to provide a different input (unless you code is envoking undefine behaviour in which case just changing you hat might well do the trick).
If, as I suspect you are printing a report with multiple times and you want to be able to shift all the items down 1 line (say) but only have to make 1 change then you should create a function that prints all items relative to a supplied orign, then to alter the position of everything all you need to do is alter the origin supplied to the function.
Instead of -
print_textbox(File, Page, 100, 100, 200, 300, "Hello");
-
print_textbox(File, Page, 100, 100, 300, 400, "World");
-
print_textbox(File, Page, 100, 100, 400, 500, "Wibble Banana Jellyfish");
-
try -
-
print_report( origin_x, origin_y )
-
print_textbox(File, Page, origin_x+0, origin_x+0, origin_y+0, origin_y+100, "Hello");
-
print_textbox(File, Page, origin_x+0, origin_x+0, origin_y+0, origin_y+100, "World");
-
print_textbox(File, Page, origin_x+0, origin_x+0, origin_y+0, origin_y+100, "Wibble Banana Jellyfish");
-
}
-
-
print_report( 100, 200 )
-
-
yes. this is a solution of that problem.
But, if I change the orientation style from portrait to landscape when I print the report, I have to change the parameters in function print_report(100,200). If there are many print_report(100,200) calls, It will cost much time on doing that multiple job.
So, What I am looking for is automatically adjusting the postion according to the paper's size( width and height )
Sign in to post your reply or Sign up for a free account.
Similar topics
by: andrea_gavana |
last post by:
Hello NG,
I am still quite a newbie with Python (I intensely use wxPython, anyway).
I would like to know what are, in your opinions, the best/faster databases
that I could use in Python (and, of...
|
by: Olav.NET |
last post by:
I am a .NET/C++ developer who is supposed to do some work with Access.
I do not know much about it except for the DB part.
Questions:
*1*
I am looking for INTENSIVE books to get quickly up to...
|
by: Cameron Laird |
last post by:
QOTW: "Python makes it easy to implement algorithms." - casevh
"Most of the discussion of immutables here seems to be caused by
newcomers wanting to copy an idiom from another language which...
|
by: Lalatendu Das |
last post by:
Dear friends,
I am getting a problem in the code while interacting with a nested
Do-while loop
It is skipping a scanf () function which it should not. I have written
the whole code below. Please...
|
by: Anthony England |
last post by:
I am considering general error handling routines and have written a sample
function to look up an ID in a table. The function returns True if it can
find the ID and create a recordset based on...
|
by: Jeff |
last post by:
In the function below, can size ever be 0 (zero)?
char *clc_strdup(const char * CLC_RESTRICT s)
{
size_t size;
char *p;
clc_assert_not_null(clc_strdup, s);
size = strlen(s) + 1;
|
by: jacob navia |
last post by:
Microsoft proposed recently (In the Technical Report 24173 presented to
the Standards Comitee) a change in the C library in the sense of more
security.
Basically, missing size information is...
|
by: Steve |
last post by:
I have read a couple articles online, read my Jesse Liberty book but I am
still confused as to just what the best practices are for using exceptions.
I keep changing how I'm working with them and...
|
by: Ryan |
last post by:
Hello,
I'm new to Access and DB's in general. I've taken over some light
duty support for a lab information system we use in house. Most of our
dates are reported as "10/31/2006 12:30:00 PM"...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |