Results 1 to 4 of 4

Thread: Looking for ideas on how to handle grid printing

  1. #1

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Looking for ideas on how to handle grid printing

    This might seem like a web post at first - it is not.

    Currently I use a SlickGrid in my web apps and when my users go to print these grids, I render the grid content into an HTML TABLE, and drop it in an IFRAME and let the browser figure out how to print it.

    Not the best results - here is one example. As you can see, the browser stacks headings and also long names and text.


    Name:  a1.jpg
Views: 273
Size:  40.7 KB
    Last edited by szlamany; Feb 19th, 2022 at 08:10 AM.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  2. #2

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Looking for ideas on how to handle grid printing

    I'm changing this logic to now take the grid of data and pass it back to the web server, where I've got a report writer engine that will render it into a PDF and deliver it to the client.

    So far, I've got it looking like this. I'm auto-creating the "layout" and "spacing" based on the slick grid column widths. That's obviously not enough - I'm guessing I'm going to have to measure the length of text and work up some complex logic to get somewhere near the browser display, but much better

    Looking for ideas...TIA!

    Name:  a2.jpg
Views: 120
Size:  24.0 KB

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  3. #3

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Looking for ideas on how to handle grid printing

    btw - this is the source of the data - the SlickGrid in a browser window
    Attached Images Attached Images  

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  4. #4

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Looking for ideas on how to handle grid printing

    fwiw...I am making progress.

    I've decided to separate how to "determine" the print style to instead working on "print suggestion" logic. That work has to be done regardless.

    Right now I'm hard-wiring a "suggestion" for my sample - a suggestion of "sub-headings".

    I noticed this particular display had a first column and last column that were the "client name" and the "staff member". I'm now pulling those "fields" into a sub-heading.

    I've also gotten more real with the "size ballooning" I need to do in order to get from HTML pixels to print-twips. Added some bold effects.

    Looking much better. All the columns still do not fit, even with the effort so far. Numbers need to be right-aligned, maybe some underlines for the heading prompts.

    If I can somehow get the grid to detect what fields can be used in a sub-heading style that would be great. If I need to create a table in my DB of each of my displays and how to suggest a better print, I can do that also...I would hate to do that...
    Attached Images Attached Images  

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width