Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CExtNSB> problems & questions #2 Collapse All
Subject Author Date
Offer Har Sep 24, 2009 - 1:07 AM

Dear Support,


I switched to the latest 2.87 to fix the grid print when having more then one page bug. I have no several issues with the print I need to resolve:


1. I see that the grid print ignores the width of columns in the grid - I hide columns by setting them 0 width like this:


pHdrCell->ExtentSet(0,0);

pHdrCell->ExtentSet(0,-1);

pHdrCell->ExtentSet(0,1);

But the column still appears in the print preview and print. Other columns, that I make narrower or wider still get the default width the column was created with.


2. I need to control the styling of the grid - add/remove grid lines when printing, color the header rows & columns’ background etc. How can this be done?


3. I need to add a couple of text lines to be printed before the grid begins.


4. I need to add page numbers


5. I need to add header & footer to each page.


Thanks,


Ron.

Technical Support Sep 25, 2009 - 12:04 PM

The grid cells are measured before the printed/previewed content is generated. We supposed there are no reasons to print/preview some partial content.
The HTML engine is mostly ready. It’s implemented as very fast parser and DOM object tree. Most of HTML tags with parameters and CSS are supported. The only "small" thing we need to do is to make it used inside Prof-UIS everywhere. We think this is enough for releasing one Prof-UIS versions with this feature only. Prof-UIS 2.87 is ready to be released but it will be dedicated to paint manager improvements including Office 2010 theme. HTML is the next step.

Technical Support Sep 25, 2009 - 6:43 AM

1) The print preview subsystem uses all the range of rows/columns displayed in the grid. You should hide rows/columns which must not appear in the printed/previewed content. The CExtGridWnd::ColumnHide(), CExtGridWnd::RowHide(), CExtGridWnd::ColumnUnHideAll(), CExtGridWnd::RowUnHideAll(), CExtTreeGridWnd::ItemHide(), CExtTreeGridWnd::ItemHideSubTree() and CExtReportGridWnd::ReportColumnActivate() methods should be used for that. You should override the CExtPPVW_Printable::OnPreparePrinting() virtual method, hide everything needed, invoke parent class method and then unhide what was hidden.

2) The CExtGridCell::TextColorSet() and CExtGridCell::BackColorSet() methods allow you to specify several different text and background colors for the grid cell and it will use them depending on the state of the cell. Prof-UIS 2.85 introduced the new __ECS_PPV color type which allows to use a completely different text and background colors when printing cells.

3, 4 and 5) This is not available right now. We are working on the new HTML everywhere feature which should provide each component with ability to draw HTML instead of plain text. The grids must have two additional HTML based features: highlighting of filtering results like Outlook 2007 / 2010 and HTML based headers/footers in printed/previewed output.


Offer Har Sep 25, 2009 - 3:21 PM

In (1) How do I catch the event that the print or print preview was finished so that I can get back my columns? I tried OnEndPrinting but it didn’t work.

Technical Support Sep 26, 2009 - 9:43 AM

It’s simple. Both printing and previewing use the same algorithm. The entire print-out document is measured and painted into an array of metafiles. Each metafile is the one printed or previewed page. The metafiles are saved into the system temporarily folder and they have GUID based names. They are removed when the printing is finished or preview is closed. The CExtPPVW_Printable::OnPreparePrinting() virtual method does this work. It measures entire the printed/previewed content, splits it into array of pages in both horizontal and vertical direction and initialized metafiles for all the printed/previewed pages. The CExtPPVW template class has two parent classes: first is the class name of some control which should obtain the printing/previewing features and second is the CExtPPVW_Printable class. Prof-UIS provides specialized template versions of the CExtPPVW template class for all the Prof-UIS grid controls. Each of specialized versions, of course, implements the virtual CExtPPVW_Printable::OnPreparePrinting() method. So, you should override it, remember some flag variable indicating that the printed output is currently to be generated, invoke the parent class method and, finally, clear the remembered flag. That’s how your grid control can really know that all the painting and measurement virtual method of it and its cells is invoked for printing/previewing or for display rendering. But this is not the only available solution. Each implementation of the CExtPPVW_Printable::OnPreparePrinting() virtual method in each specialized version of the CExtPPVW template class invokes the CExtPPVW_Printable::OnPreparePrinting_Begin() virtual method at startup, the CExtPPVW_Printable::OnPreparePrinting_End() virtual method before returning execution control and the CExtPPVW_Printable::OnPreparePrinting_Progress() virtual method during generation of page metafiles array. You can override these virtual methods. The begin/end virtual methods can save some flag which indicates whether the printed/previewed content is currently generated and your grid control and its grid cells should perform some specific measurement and/or painting. The progress method allows you to watch the printing/previewing content generation step by step and to perform some displaying of it in some progress common control. The CExtPPVW_Printable::OnPreparePrinting_Progress() virtual method can return a false() flag and the printed/previewed content generation will be immediately canceled. So, if your app can potentially generated 10000 pages to print/preview and your users don’t want until such count of pages will be ready to print/preview, then you have an ability to cancel the printing/previewing process. If your users have some patience to wait until 10000 pages will be ready for printing/previewing, the it’s OK. The previewing of 10000 pages will work OK because only the temporarily enhanced metafile file names are kept in memory - the printing/previewing subsystem will not eat 10000 file handles.


Offer Har Sep 25, 2009 - 8:29 AM

1) You missed the issue of the column widths - why does it not take the actual width of the column?


3,4,5) When will this be ready?