Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««910111213»»

Creating a PDF from a Stored Procedure Expand / Collapse
Author
Message
Posted Thursday, February 28, 2013 11:18 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, June 23, 2013 11:10 PM
Points: 3, Visits: 34
Hey Ivica. Your stored procedure is very good. Thanks for that. I just want to know one thing. I am trying to get 20 columns per row. I have changed column lengths of #pdf , #xref, #text and also modified substring part to include the length.. tables and all that. The query executes properly.
The problem is that the pdf displays rows only upto a certain length. Rest of the columns are discarded or maybe cutoff.

How do I turn the orientation of pdf from portrait to landscape?
OR
How do I increase page width?

I have taken a look at Acrobat Reference Manual but didn't find anything useful as for page width or orientation.
I got some annotations for Font and RichMediawindow. For eg.
3 0 obj
<< /Type /Page
/Parent 4 0 R
/MediaBox [0 0 612 792]
/Resources << /Font << /F3 7 0 R
/F5 9 0 R
/F7 11 0 R
>>
/ProcSet [/PDF]
>>
/Contents 12 0 R
/Thumb 14 0 R
/Annots [ 23 0 R
24 0 R
]
>>
endobj

Is there anything like this I can change in sp to increase page width or orientation.

BTW. Thanks again. Your SP is great.
Post #1425362
Posted Friday, March 1, 2013 3:01 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, June 23, 2013 11:10 PM
Points: 3, Visits: 34
Anyway I solved my problem. Apparently acrobat api doesn't have any width or orientation properties.
Width is controlled by Mediabox parameters and orientation is controlled by Rotation property.
I was able to accommodate 15 columns with consistent spacing among all rows by increasing mediabox's parameters.

That gives it a landscape orientation effect.

Also whatever formatting I did was only before the sql2pdf execution. i.e. By using SPACE() function in sql.
Maybe I'll look into how to directly enter a whole table as a parameter.

Once again.
Thanks alot.

Regards,
C.Pednekar.
Post #1425407
Posted Wednesday, May 15, 2013 4:47 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, June 13, 2013 6:28 AM
Points: 1, Visits: 15
Has anyone been able to increase the max line length above 80 characters?

Nevermind. found it.

FOR SELECT SUBSTRING((code + SPACE(81)), 1, 80) FROM #text WHERE idnumber BETWEEN ((@nopg * 60) + 1) AND ((@nopg + 1) * 60 )

To

FOR SELECT code FROM #text WHERE idnumber BETWEEN ((@nopg * 60) + 1) AND ((@nopg + 1) * 60 )
Post #1453007
Posted Thursday, June 13, 2013 5:59 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, June 23, 2013 11:10 PM
Points: 3, Visits: 34
I am sorry I couldn't respond to you any early. Didn't you read my previous comment?
I have clearly stated that length of the pdf horizontally can be controlled by MediaBox parameter.

But here is the catch.

Before running the sql proc you have to make sure of three things.

1. Apply consistent spacing using the SPACE() function in sql server.
2. Increase width of following parameters -
- #pdf , #xref, #text and MediaBox
3. Enable a monospace font in the sql2pdf proc. If you don't then despite of equivalent and consistent spacing the formatting would be messed since other fonts which are not monospace output characters in different widths.

Finally fill the table with the formatted data and then run the query.

TBH you can work a lot on this and get a decent enough output but its really not worth the effort.
I asked my manager and got this functionality replaced with SSRS 2005.

Anyway.
Later.
Post #1462998
Posted Thursday, July 18, 2013 10:23 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, August 8, 2013 10:09 PM
Points: 4, Visits: 25
Hi
could you please help me to formatthe pdf
like put company imange
header,footer, page mumber defalt created date

it will be very help full if you reply quick

Thanks
Jalpa
Post #1475267
Posted Tuesday, October 29, 2013 6:34 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, September 11, 2014 7:40 AM
Points: 9, Visits: 59
How can you make pdf landscape? I have a report that has 20 columns.


Post #1509621
Posted Tuesday, October 29, 2013 6:35 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, September 11, 2014 7:40 AM
Points: 9, Visits: 59
How can you make pdf landscape? I have a report that has 20 columns.


Post #1509622
Posted Tuesday, October 29, 2013 9:53 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, September 11, 2014 7:40 AM
Points: 9, Visits: 59
Where did you increase Mailbox params? I am trying to get 20 columns in one report. It keeps getting truncated.


Post #1509647
Posted Thursday, October 31, 2013 8:23 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, September 11, 2014 7:40 AM
Points: 9, Visits: 59
I was able increase width. However, my row still gets truncated. How can I increase the lenght of the row so it does not truncate

I set MediaBox to:
INSERT INTO #pdf (code) VALUES ('/MediaBox [ 10 0 900 842 ]')

I can see the width increased on the page but not the row it self.

Thanks, Richard



Post #1510205
Posted Thursday, October 31, 2013 8:38 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, September 11, 2014 7:40 AM
Points: 9, Visits: 59
Hi I implemented your code change but my line lenght did not change. My lines still get runcated.

I replace:
FOR SELECT code FROM #text WHERE idnumber BETWEEN ((@nopg * 60) + 1) AND ((@nopg + 1) * 60 )

with this code:

FOR SELECT SUBSTRING((code + SPACE(81)), 1, 300) FROM #text WHERE idnumber BETWEEN ((@nopg * 60) + 1) AND ((@nopg + 1) * 60 )

Any ideas on what I need to do to increse line/row lenght?
Thanks, Richard



Post #1510216
« Prev Topic | Next Topic »

Add to briefcase «««910111213»»

Permissions Expand / Collapse