|
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.
|
|
|
|
|
Johan Rosengren wrote: on the first sub-page
What are sub-pages?
~~~~~~~~~~~~~~~
CDRom
|
|
|
|
|
Page of the multi-page template. That is, not pages as in the printed report, but rather in the temlpate
|
|
|
|
|
hi there,
i am really curious if i can expose all these classes and their functionality through VB.net.
is there a DLL that i can include or something in vb.net to gain access thru vb
really i know nothing about c, c++, c#
thx in advance
Maged A. Reda
|
|
|
|
|
I, on the other hand, know very little about VB/VB.net.
I assume that it is possible, at least the report generator part, but there would have to be an access-layer around the generator, as it uses the MFC-specific data classes CString and CStringArray to set information. Anyone interested in giving it a try? I have, as stated, too little experience of VB.
|
|
|
|
|
I want to republish this article and others projects of you (total 10). In the articles you give general permission to use it any way. So, I think it is ok. Looking for your comment.
Tomorrow is a blank page
www.kuashalabs.com
|
|
|
|
|
You can even take the code and put your name in all the files, stating that you wrote it.
This liberal licence is not because I'm crazy, it is for the simple reason that I rather prefer the code to be used (in my monstrous megalomania) than just sitting on a site somewhere, and I know than many companies have concerns using anything that in the slightest way can be a risk, copyright- or ownershipwise.
Note, however, that I maintain the code, and it is actually updated every now and then (for the moment, there is for example implemented a Redo-function in the underlying CDiagramEditor ) - you might either want to keep an eye on the articles themselves, keep in contact with me or just keep this in mind , whatever is appropriate in your situation.
|
|
|
|
|
Thank you. I'll just republish the article and tryning to gather very good visual c++ free resources all around. It is sometimes greatly help people.
Thanks again.
Maruf Maniruzzaman
www.kuashalabs.com
Tomorrow is a blank page
|
|
|
|
|
Hello,
A feature that would be nice is a way to have the report template as a resource inside the application itself.
Right now, one can extract it at runtime to a temp file and then use it to generate the report.
But an automatic feature to read the template from a resource would be nice.
Zindine
|
|
|
|
|
Your wish is my command
This is actually already implemented, just call AddTemplate with the resource id. The resource must be set as having the custom type RG_REPORT .
|
|
|
|
|
I think the following features can be added:
1.Group and Ungroup.
2.Alignment without the reference shape.
3.Ability to set tranparency in object fill properties.
4.Drag and drop the database list item from the listbox to the canvas,if there is a XD++ like toolbox:
XD++ MFC Library (can be found with: http://www.ucancode.net) will be very useful.
I will starting work now,but if you can include a class diagram of your project that will be very useful.
Great work!!
Thanks!
|
|
|
|
|
Thanks for the feedback!
Your points:
cindyonlyone wrote:
1.Group and Ungroup.
This is already implemented in the underlying framework. I will add UI for it the next update round, if you are in a hurry, you might want to download my UML-editor here at CodeProject, where grouping is already implemented. In short, you'll have to add Group/Ungoup menu alternatives, and call the singular appropriate functions in the editor.
cindyonlyone wrote:
2.Alignment without the reference shape.
Here I'm slightly lost. What to align with if not another object?
cindyonlyone wrote:
3.Ability to set tranparency in object fill properties.
Transparency is accomplished by unchecking the Fill checkbox in the relevant objects.
cindyonlyone wrote:
4.Drag and drop the database list item from the listbox to the canvas,if there is a XD++ like toolbox:
XD++ MFC Library (can be found with: http://www.ucancode.net) will be very useful.
Adapting to external code is left as an exercise for the reader
cindyonlyone wrote:
if you can include a class diagram of your projec
I hear and obey! Check the documentation downloads. You'll find UML-diagrams
in each doc. I note, however, that the index.html file for the report editor is empty - nevertheless, re_uml.html contains the UML-diagram, and you can access class information through Classes/index.html.
You might also, if you are interested, want to download the docs for CDiagramEditor , from http://www.codeproject.com/miscctrl/diagrameditor.asp[^]
|
|
|
|
|
Your response is very clear!
Thanks And Best Regards
|
|
|
|
|
First at all TNX for the grate work.
I change the line per inch in the grid from int to float that give me better control on row high, its very useful for label print.
How can I send u my change?
|
|
|
|
|
Thanks for the kind words!
galroy wrote:
How can I send u my change?
There is a small field towards the bottom of this text, with the text [e-mail]. this is my proper e-mail address. Otherwise, my e-mail is johan.rosengren@telia.com
|
|
|
|
|
Hi Johan!
Great work thank you a lot !
If possiblem, for the future, take in consideration a MULTI-BAND design in the same worksheet
For example
- Header band
- Details band
- Footer band
Thank you
G.Luca
|
|
|
|
|