473,320 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

about general report function

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
Jun 8 '06 #1
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

Expand|Select|Wrap|Line Numbers
  1. print_textbox(File, Page, 100, 100, 200, 300, "Hello");
  2. print_textbox(File, Page, 100, 100, 300, 400, "World");
  3. print_textbox(File, Page, 100, 100, 400, 500, "Wibble Banana Jellyfish");
  4.  
try

Expand|Select|Wrap|Line Numbers
  1.  
  2. print_report( origin_x, origin_y )
  3.     print_textbox(File, Page, origin_x+0, origin_x+0, origin_y+0, origin_y+100, "Hello");
  4.     print_textbox(File, Page, origin_x+0, origin_x+0, origin_y+0, origin_y+100, "World");
  5.     print_textbox(File, Page, origin_x+0, origin_x+0, origin_y+0, origin_y+100, "Wibble Banana Jellyfish");
  6. }
  7.  
  8. print_report( 100, 200 )
  9.  
  10.  
Jun 8 '06 #2
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 )
Jun 8 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

10
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...
20
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...
97
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...
33
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...
33
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...
53
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;
7
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...
4
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...
8
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"...
0
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...
0
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...
0
isladogs
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...
0
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...
0
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...
0
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...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
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....
0
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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.