473,654 Members | 2,990 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

about general report function

9 New Member
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(F ile, 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 1120
Banfa
9,065 Recognized Expert Moderator Expert
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
linbl352
9 New Member
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(10 0,200). If there are many print_report(10 0,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
1524
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 course, I should be able to "link" everything with a wxPython GUI)? Specifically, I work on Reservoir Simulation, and usually I have to store a discrete/huge amount of data (it depends on the oil field). As you may have understood, I know almost...
20
3322
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 speed. I like books with practical exercises, and also with test questions (like cert books) *2*
97
4351
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 doesn't have immutable variables. Their real problem is usually with binding, not immutability." - Mike Meyer Among the treasures available in The Wiki is the current copy of "the Sorting min-howto":
33
3125
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 help me in finding why such thing is happening and what the remedy to it is. Kindly bear with my English. int main ()
33
3142
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 that ID, otherwise it returns false. **I am not looking for comments on the usefulness of this function - it is only to demonstrate error handling** There are three versions of this code. David Fenton says under the earlier thread "DAO...
53
4057
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
2019
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 passed to the new primitives like strcat_s(), gets_s(), and many others. The good thing in this proposal is that the specifications of the new library are much more precise than in the existing library, an improvement that made me start...
4
1849
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 it has now, after 15k lines of code resulted in a royal mess! It's my hope to ask some specific questions with scenario examples and that some of you might offer a little guidance or general suggestions. 1) string...
8
4425
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" (With seconds listed in the report field). However, nobody wants to see the seconds. So I tried to format it =Format(DateCollected, "mm/dd/yy hh:nn AM/PM"). Works great, right? Well.. yeah for the most part. However if we
0
8375
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8815
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8707
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8482
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2714
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1593
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.