December 18, 2003 at 12:36 am
convert int column into varchar by cast
December 18, 2003 at 3:08 am
quote:
convert int column into varchar by cast
i dont get what u said...sorry...coz the column of psopdf is already in varchar
why sqlserver tried to convert 'TOTO' in to the INT column? where does this "INT column" come from ? i really dont get it...sorry
can u pls explain ? tks
January 21, 2004 at 12:41 pm
try like this --> SELECT CAST(nb_client AS VARCHAR) + ' ' + CAST(tx_shor_name AS VARCHAR) ...
February 23, 2004 at 9:45 am
WOW! A++++++ this is a super procedure! Kudos to you for all your hard work! I am using this on a production DB that logs all firewall / web traffic event logs. I then setup this up as a job that runs daily and creates pdf reports based upon various criteria. Again, great job on the procedure and thanks for giving those easy to understand screenshots and how to's!
February 23, 2004 at 1:59 pm
Excellent, excellent sp!
March 3, 2004 at 9:25 am
Very nice tool, only critic I would have is a description of the variables that are used in the procedure.
March 25, 2004 at 3:47 am
Hi,
Excellent script.
However, there is a glich. No sorting in #text and in psopdf, hence you cannot guarantee
the resulting pdf report data order.
So, can you please include:
CREATE TABLE psopdf (
pkey int identity (1,1)
code NVARCHAR(80))
and ...
INSERT INTO #text(code) (SELECT code FROM psopdf order by pkey)
If you don't believe, try couple times to run this:
set nocount on
declare @i int
set @i = 1
while @i <1000
begin
insert into psopdf(code) values(str(@i,10))
set @i=@i+1
end
exec sql2pdf 'test'
Regards,
r4
March 25, 2004 at 3:53 am
If I have about 1650 rows in the table
psopdf the SP will crash at line
162:
Server: Msg 8152, Level 16, State
4, Procedure sql2pdf, Line 162
String
or binary data would be truncated. The
statement has been terminated.
No
line in the psopdf is longer than about
60 chars (only givenname, surname,
telephone number).
With less than
1600 rows the SP works fine.
--------------------------------------
Set in table #pdf code
nvarchar(400) and @trenutnired
nvarchar(400)
April 14, 2004 at 12:10 pm
Hello,
I'm trying to use this procedure with .asp and ntext fields, but I'm having some problems with it.
How can I deal with ntext fields, and page breaks?
Thank you,
Augusto
April 20, 2004 at 3:43 am
Page dimension is 80x60 chars.You can make virtual table:
INSERT psopdf(code)
SELECT SUBSTRING((city+ SPACE(20)),1,20)
+ SUBSTRING((state+ SPACE(10)),1,20)
+ SUBSTRING((address+ SPACE(25)),1,20)
FROM authors
EXEC sql2pdf 'demo1'
Playing with SUBTRING you can get text alignment (demo1 has left align).
This is tip how to get exact lenght for varchar.
For new page you have to insert blank row into the psopdf and every 60th row will be new page.
August 26, 2004 at 3:44 am
Very good job. I think M. Ivica has shown us a road, we would never have found by ourselves. Thanks, I will use it in near future.
Leendert van Staalduinen.
August 26, 2004 at 8:50 am
wow! shows how easy it really is, given a little time to do it.
I've checked out the acrobat specs doc, and from that there's plenty of potential for a lot of formatting control, though you'd have to use either an xml file for the parameters around each bit, or a mor complex table that could hold it.
August 26, 2004 at 9:23 am
Hi I wasn't able to create the file. Everything compiles fine but no output file is generated.....
Also, is the following line in the code legal? i found some funky chars in it:
INSERT INTO #pdf (code) VALUES ('%ÓÓÓÓ')
Please let me know
Thanks,
Jag2100.
August 26, 2004 at 4:16 pm
There are problems when generateing more than one page. It looks that this procedure breaks every 60 lines into a page. One page works fantastically. But when I have more than 60 lines, my Acrobat Reader 6.0 will encounter an error "There is a problem reading this document (114)".
Any thought? Lower Acrobat reader works fine?
August 26, 2004 at 7:57 pm
Enjoyed this procedure. Thanks!
-gol
Viewing 15 posts - 16 through 30 (of 152 total)
You must be logged in to reply to this topic. Login to reply