|
Thanks for the contribution - the list of small fixes and additions is making an update necessary soon
|
|
|
|
|
I've downloaded your code a few weeks ago and saved it in my "Don't forget to see again cause it's good" folder...
Now that I had time enough to see it I'm really surprised, I mean, Your code rocks!... This is something like "get CR source code by accident" but only with the functionality that I need... not more not less... what more can I say?... Thanks for that!
Finally... 2 things:
1.- I have to recognize your disposition to answer all posts related with your code and, over all, the way you do... Is good to find people like you on internet. Once again... THANKS A LOT (and this is not an argument to help
2.- I'm a VB/ASP/VB.Net/ASP.Net programmer... even when I've done some work with c++, I don't consider myself a c++ Programmer, that's why I decided to ask you first. I'd like to have that functionality on a Web page, and when I saw your code the first thing that comes to my "humiliated-by-your-code" mind was ATL to make some sort of OCX encapsulating the Report Generator Code...
This could be possible? or I'm just having some kind of weird fantasies?
Regards
PS: Sorry about my english...
Jean Paul Mir V.
http://www.gruposid.com
|
|
|
|
|
Thanks for the nice feedback!
1. Thanks for the feedback again
2. Everything is possible, of course. I'm relying on MFC for lots of stuff, but the most involved part is probably to get rid of CString and CStringArray , as well as CObArray which I use to store objects. It will take time to do this, however, time which I just don't have. Anyone feeling up to the task
PS: I'm not a native English speaker either, and you would have fooled me if you would have skipped your PS.
|
|
|
|
|
Hi Johan,
First of all, thanks for your fabulous work;)
It worked at once.( under VC++ 6)
I have no problems in Simple Dialogs, and SDI.
But when i use a MDI environnement, the output doesn't work well
I use two templates with some data.
For instance i draw a line crossing a circle, in MDI the output shows the line above the circle.
in MDI Some fields aren't shown.
In fact the result of the output is very different from what appears in the Report Creator Module.
Unhappily i intend to use the report in MDI...
If you have any idea . I can send you the output. ( my printer is Adobe acrobat Distiller )
Best regards,
Daniel
|
|
|
|
|
Thanks for the feedback!
To simplify my bug-hunting, I would much prefer if you sent the file you saved from the report creator exhibiting the problem.
|
|
|
|
|
Hi,
Thank you for your answer
Here is the files generated with ReportCreator
first One
paper:793,1122;
report_label:2.104167,3.468750,5.166667,3.895833,Cher Client\comma\newlineVoici votre relevé concernant les opérations,TEXTE_1,0,Times New Roman,120,0,1,0,0,0,0,1,10276524,2,1242292;;
report_box:5.854167,1.541667,6.854167,2.354167,,,0,1,0.000000,0,0,1,255;
report_line:2.375000,1.812500,7.552083,1.812500,,ligne2,0,0.031250,0,65280;
report_field:5.729167,2.437500,6.895833,2.770833,,Adresse,0,Times New Roman,120,0,0,0,0,0,1,4,10276524,2,1944053136;;
report_label:1.135417,2.854167,4.416667,3.072917,texte,,0,Times New Roman,120,0,1,0,0,0,0,5,10276524,2,1944053136;;
report_field:4.218750,9.781250,6.250000,10.239583,,#P1,0,Times New Roman,120,0,0,0,0,0,1,6,10276524,2,1944053136;;
report_field:1.625000,9.781250,3.656250,10.239583,,#D1,0,Times New Roman,120,0,0,0,0,0,1,7,10276524,2,1944053136;;
report_grid:1.177083,4.364583,7.739583,9.552083,,Grid,0,1,0.000000,0,0,1,0.000000,0,0,0,0.000000,0,0,4,1.572917#Times New Roman#120#0#0#0#0#0#0#colonne1|3.937500#Times New Roman#120#0#0#0#0#0#0#c2;
report_ellipse:1.041667,1.708333,1.895833,2.468750,,,0,1,0.000000,0,0,1,65280;
here is the second one
paper:793,1122;
report_grid:1.187500,1.010417,7.427083,10.010417,,Grid,0,1,0.000000,0,0,1,0.000000,0,0,0,0.000000,0,0,4,1.572917#Times New Roman#120#0#0#0#0#0#0#colonne1|3.937500#Times New Roman#120#0#0#0#0#0#0#c2;
report_field:5.395833,10.406250,7.364583,10.864583,,#P,0,Times New Roman,120,0,0,0,0,0,1,2,10790620,2,1944053176;;
report_field:1.218750,10.395833,3.250000,10.854167,,#D,0,Times New Roman,120,0,0,0,0,0,1,3,10790620,2,1944053136;;
I hope they will be useful.
Best regards
Daniel
|
|
|
|
|
I created a rough MDI-project based on the SDI-demo from this article, and couldn't reproduce the problem - perhaps you could mail me a minimum project exhibiting the error for further analysis?
|
|
|
|
|
Thats all man youve made a GREAT work...
You have got a new fan!
|
|
|
|
|
Thanks a lot for the feedback - I'm getting embarassed
|
|
|
|
|
Thanks for this code very much. It helped me a lot.
I have a little question that i don't understand. Here it is:
I created grid and added some data. When data lines is more than grid lines data become ugly (writes on existing field). So how do we do that? I can't see in the doc. Is it done by sub-templates...
Thanks for any help.
dx
|
|
|
|
|
Thanks for the feedback!
The grid should continue to the next page by itself, so this might well be a bug. If you want, feel free to mail the report file to me and I'll take a look at it.
|
|
|
|
|
I find out what's the problem, i tried to print into the main window (OnDraw with m_Report.Print(pDC) and in OnPrint m_Report.PrintPage(pDC,pInfo->mCurentPage). Just erased OnDraw m_Report.Print(pDC) and everything okej(so Print(pDC) shows all pages in one), but there is nothing on the screan. Maybe i'm missing something.
If i put m_Report.PrintPage(CDC) in OnDraw it's okej(in the main window show first page).
But there is another problem (maybe it's not related with this code)when i preview in Print Prieview mode and close it everything dissapear what was in the main screan. I tried several things, but nothing helps.
p.s. i find out one thing, when the line in OnPreparePrinting --- pInfo->SetMaxPage( m_reportGenerator.CalculatePages() ); is commented everything is fine, but in preview mode shows only one page.
Thank you for any response.
dx
|
|
|
|
|
I'm scratching my head over this one. Could you mail a minimum project displaying the problem directly to me?
|
|
|
|
|
Hello all
Say I have a program - for which I have no source code, and it prints a "report" in this case it is actually a Point-Of-Sale RECEIPT going to either a SERIAL or PARALLEL printer port
I want tyo TRAP, the print Job, before it get to the port, re-package it (add some Logo, and header / footer lines) and then let go of it to the intended printer..
Can this be done? Any suggestions please (using MFC / C++)
Thanks
Alex
|
|
|
|
|
I think that this would be very, very difficult to accomplish. I assume that it is saved as a metafile by the spooler, and eventhough theoretically possible to go into a metafile, play the instructions an add more, you'll have to suspend the printjob to inject your own commands.
In your case, I would experiment by printing to file and visit www.wotsit.org for info on the metafile format (if this is indeed the format used), and search for any information on the print spooler on both www.msdn.microsoft.com as well as generally on the net.
If it's instead possible to export the report to text format, you could write a print server yourself - letting an application check a given directory for this file, printing it the way you want as soon as the file is possible to open exclusively (that is, being completely exported from the other application)
|
|
|
|
|
Hello Johan
Followed your link, did a bit of looking around, found out that my starting point should be hrough a call to AddMonitor() - but, tried this and I have no idea which DLLS I need for the INF file.
It seems that the way to go about it, is to Add a Printer monitor, intercept the call, halt the job, do something to it, then releasing the job...
Any more suggestions?
Cheers
Alex
|
|
|
|
|
Hmmm, the monitor is inserted between the final output and the port - as far as I understand, this means that you'll have to know the printer language that the printer driver is finally sending out. This will be stuff like HP:s PCL or PostScript, I assume. I think you might be investigating a too low level here. Isn't there a possibility to - for example - output to file from the application?
|
|
|
|
|
Hello again
Well, the whole point is that I am NOT the developer of that other aplication, nor do I know what print driver is used, it can be anything - I am trying to find here a genereic solution to a problem, here are the details again
1) There is a "Program" that prints to a printer
2) I have no way to check what the program is doing
3) No idea if it writes directly to the printer or through a spooler
4) I want to intercept the job, add to it something
5) While I am adding, I want to halt / pause the printer
6) When I am done adding, release the job
7) Let the printer driver do what it is expected to...
The "Interceptor" will be programmed to take some configuration parameters, depending on the printer used, port / COM / LPT etc... but the rest needs to be done in a generic way...
So, what do you think?
Cheers
Alex
|
|
|
|
|
Alex Evans wrote:
Well, the whole point is that I am NOT the developer of that other aplication, nor do I know what print driver is used, it can be anything - I am trying to find here a genereic solution to a problem
I understood that much Therefore, I think that a monitor is not what you're after.
All printers print throuhg the spooler in Windows (you could do it directly, but consider this a truth for all practical purposes). I assume that it is possible to halt and resume, but the problem is definitely to inject your own stuff into the spooler file. For this, you'll primarily have to know the format of the file, which, if memory serves, is a Windows metafile that is translated by the printer driver.
You have other options besides the above, given a minimum amount of control over the machine the program is running on. You can set the default printer to print to file, you could experiment with "installing" a basic text printer (if those drivers still exist in windows). If you can get output to a specific file - and now I don't mean through modifying the program you don't have the source for, but by experimenting with printer driver settings, you'll be able to load and modify the output. This is where I think you should spend your time investigating.
|
|
|
|
|
Each time I try to set the font of an object in the ReportEditor to a non-western script (Central European in my case), I always get Western script later when I open object's font properties. Also, the final report itself (whether in print-preview mode or printed) displays non-western characters badly.
So, are non-western font scripts supported at all, or am I doing something horribly wrong?
--
Vladimir Svrkota,
CardWare
Novi Sad, Serbia and Montenegro.
|
|
|
|
|
I hardly think you are doing anything wrong - there is nothing special prohibiting non-western fonts. If you examine the returns from the font selection dialog, does the data seem ok? If you create a MFC project from scratch, adding a font dialog, will it work ok?
|
|
|
|
|
Thanks for the answer. I looked into the source of CDrawObject and its derivates and found out that all font attributes (name, size, color, bold, italic,...) are supported, but not the charset. That's why LOGFONT structure used for drawing text is always set to western (ANSI) charset. The same thing happens with ReportCreator (DiagramEditor): MFC font selection dialog is capable of returning the font's charset, but that information is never used and therefore never stored into *.rpt file. I think fixing these little problems would make your reporting library even greater. A next release, maybe?
--
Vladimir Svrkota,
CardWare
Novi Sad, Serbia and Montenegro.
|
|
|
|
|
Vladimir Svrkota wrote:
A next release, maybe?
There will indeed be. Thanks for the time taken to sort this out!
|
|
|
|
|
it is very good!
I test a sample with two sub-table in multi-page,
what i want is :
the first sub-table, is only lay in the first page,
the second sub-table cross the first and the second page,
but the fact is :
the first sub-table display one the second page, too.
it looks very ugly.
how to do ?
|
|
|
|
|
This should indeed be possible, but very difficult answering without seeing some data. But if the first table is unrelated to the second, this will be the effect. That is, if you have a table with the id Name1 on the first sub-page, and one with Name2 on the second, Name1 can render 50 lines and you fill it with 51 lines, it will not start to fill Name2 . To accomplish this, you'll have to name the second table Name1 as well.
If this is the case, feel free to mail your report files to me, and I'll take a look at it.
|
|
|
|
|