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
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 -
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(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 )
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 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...
|
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*
|
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":
|
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 ()
|
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...
| |
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 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...
|
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...
|
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
|
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...
|
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,...
| |
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...
|
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...
|
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,...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
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...
| |