Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Thursday, March 29, 2012

Directly printing Report from RS without previewing

Hi All,
Is there a way to send a report from Reporting service directly to the printer without previewing in VS 2005 web application? I tried out an example which exports the report into a pdf and then sends it over to the printer but apparently it did not print. It stopped working after saving the reoprt on the client machine. The article is located at

http://www.codeproject.com/vb/net/RSPrintLandscape.asp

Thanks for the help in advance.

Sanat

what version ? 2000 or 05 ?

printer on the server or on the client ?
if you look at the samples there is a printer delivery sample.

in rs 2000 I hacked that up some to output to a printer w/o the subscription stuff.
basicly when Render() is called it makes a windows EMF file that can then be sent to a printer as a page of output.

do that in a loop and you get printed copy.

just set the page up at the start with the right settings...

|||

and, you know how send the emf correctly to a printer?...

mm.. or how to construct a Printer Settigs or PrinterDocument?...

what should i do?

this is a part of code, and


PrinterSettings printerSettings = new PrinterSettings();
printerSettings.MaximumPage = m_numberOfPages;
printerSettings.MinimumPage = 1;
printerSettings.PrintRange = PrintRange.SomePages;
printerSettings.FromPage = 1;
printerSettings.ToPage = m_numberOfPages;
printerSettings.PrinterName = "Hp Dj 550"; //here goes printer's name.
PrintDocument pd = new PrintDocument();

pd.PrinterSettings = printerSettings;

pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);

pd.Print();

Inside of pd_PrintPage method, i don't have anything about the printer, just code to conver a byte[] into a graphics file... what ever, nothing goes to the printer... thanks in advance for your attention.

|||Have you taken a look at http://www.gotreportviewer.com/? There is a sample called "Print a report from a console app" that uses the ReportViewer control to do this.|||

Thanks for the link Brian - this is almost exactly what I need to do (automatically print local reports).

My ADO.NET skills are not quite up to par - how would I modify the Run method of this example to execute an existing server based report that I have? I have managed to convert the report from an RDL to an RDLC, and added it to my Console Project with VB.NET. In addition, I created a new Data Set within this project that returns the data from the original stored procedure that was used for the RDL file. I now need to associate this new Data Set with the RDLC report, as well as pass some parameters to it, but I am not sure how to proceed.

Any suggestions/direction would be greatly appreciated.

Thanks!

Directly printing Report from RS without previewing

Hi All,
Is there a way to send a report from Reporting service directly to the printer without previewing in VS 2005 web application? I tried out an example which exports the report into a pdf and then sends it over to the printer but apparently it did not print. It stopped working after saving the reoprt on the client machine. The article is located at

http://www.codeproject.com/vb/net/RSPrintLandscape.asp

Thanks for the help in advance.

Sanat

what version ? 2000 or 05 ?

printer on the server or on the client ?
if you look at the samples there is a printer delivery sample.

in rs 2000 I hacked that up some to output to a printer w/o the subscription stuff.
basicly when Render() is called it makes a windows EMF file that can then be sent to a printer as a page of output.

do that in a loop and you get printed copy.

just set the page up at the start with the right settings...

|||

and, you know how send the emf correctly to a printer?...

mm.. or how to construct a Printer Settigs or PrinterDocument?...

what should i do?

this is a part of code, and


PrinterSettings printerSettings = new PrinterSettings();
printerSettings.MaximumPage = m_numberOfPages;
printerSettings.MinimumPage = 1;
printerSettings.PrintRange = PrintRange.SomePages;
printerSettings.FromPage = 1;
printerSettings.ToPage = m_numberOfPages;
printerSettings.PrinterName = "Hp Dj 550"; //here goes printer's name.
PrintDocument pd = new PrintDocument();

pd.PrinterSettings = printerSettings;

pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);

pd.Print();

Inside of pd_PrintPage method, i don't have anything about the printer, just code to conver a byte[] into a graphics file... what ever, nothing goes to the printer... thanks in advance for your attention.

|||Have you taken a look at http://www.gotreportviewer.com/? There is a sample called "Print a report from a console app" that uses the ReportViewer control to do this.|||

Thanks for the link Brian - this is almost exactly what I need to do (automatically print local reports).

My ADO.NET skills are not quite up to par - how would I modify the Run method of this example to execute an existing server based report that I have? I have managed to convert the report from an RDL to an RDLC, and added it to my Console Project with VB.NET. In addition, I created a new Data Set within this project that returns the data from the original stored procedure that was used for the RDL file. I now need to associate this new Data Set with the RDLC report, as well as pass some parameters to it, but I am not sure how to proceed.

Any suggestions/direction would be greatly appreciated.

Thanks!

Directly printing Report from RS without previewing

Hi All,
Is there a way to send a report from Reporting service directly to the printer without previewing in VS 2005 web application? I tried out an example which exports the report into a pdf and then sends it over to the printer but apparently it did not print. It stopped working after saving the reoprt on the client machine. The article is located at

http://www.codeproject.com/vb/net/RSPrintLandscape.asp

Thanks for the help in advance.

Sanat

what version ? 2000 or 05 ?

printer on the server or on the client ?
if you look at the samples there is a printer delivery sample.

in rs 2000 I hacked that up some to output to a printer w/o the subscription stuff.
basicly when Render() is called it makes a windows EMF file that can then be sent to a printer as a page of output.

do that in a loop and you get printed copy.

just set the page up at the start with the right settings...

|||

and, you know how send the emf correctly to a printer?...

mm.. or how to construct a Printer Settigs or PrinterDocument?...

what should i do?

this is a part of code, and


PrinterSettings printerSettings = new PrinterSettings();
printerSettings.MaximumPage = m_numberOfPages;
printerSettings.MinimumPage = 1;
printerSettings.PrintRange = PrintRange.SomePages;
printerSettings.FromPage = 1;
printerSettings.ToPage = m_numberOfPages;
printerSettings.PrinterName = "Hp Dj 550"; //here goes printer's name.
PrintDocument pd = new PrintDocument();

pd.PrinterSettings = printerSettings;

pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);

pd.Print();

Inside of pd_PrintPage method, i don't have anything about the printer, just code to conver a byte[] into a graphics file... what ever, nothing goes to the printer... thanks in advance for your attention.

|||Have you taken a look at http://www.gotreportviewer.com/? There is a sample called "Print a report from a console app" that uses the ReportViewer control to do this.|||

Thanks for the link Brian - this is almost exactly what I need to do (automatically print local reports).

My ADO.NET skills are not quite up to par - how would I modify the Run method of this example to execute an existing server based report that I have? I have managed to convert the report from an RDL to an RDLC, and added it to my Console Project with VB.NET. In addition, I created a new Data Set within this project that returns the data from the original stored procedure that was used for the RDL file. I now need to associate this new Data Set with the RDLC report, as well as pass some parameters to it, but I am not sure how to proceed.

Any suggestions/direction would be greatly appreciated.

Thanks!

sql

Directly printing Report from RS without previewing

Hi All,
Is there a way to send a report from Reporting service directly to the printer without previewing in VS 2005 web application? I tried out an example which exports the report into a pdf and then sends it over to the printer but apparently it did not print. It stopped working after saving the reoprt on the client machine. The article is located at

http://www.codeproject.com/vb/net/RSPrintLandscape.asp

Thanks for the help in advance.

Sanat

what version ? 2000 or 05 ?

printer on the server or on the client ?
if you look at the samples there is a printer delivery sample.

in rs 2000 I hacked that up some to output to a printer w/o the subscription stuff.
basicly when Render() is called it makes a windows EMF file that can then be sent to a printer as a page of output.

do that in a loop and you get printed copy.

just set the page up at the start with the right settings...

|||

and, you know how send the emf correctly to a printer?...

mm.. or how to construct a Printer Settigs or PrinterDocument?...

what should i do?

this is a part of code, and


PrinterSettings printerSettings = new PrinterSettings();
printerSettings.MaximumPage = m_numberOfPages;
printerSettings.MinimumPage = 1;
printerSettings.PrintRange = PrintRange.SomePages;
printerSettings.FromPage = 1;
printerSettings.ToPage = m_numberOfPages;
printerSettings.PrinterName = "Hp Dj 550"; //here goes printer's name.
PrintDocument pd = new PrintDocument();

pd.PrinterSettings = printerSettings;

pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);

pd.Print();

Inside of pd_PrintPage method, i don't have anything about the printer, just code to conver a byte[] into a graphics file... what ever, nothing goes to the printer... thanks in advance for your attention.

|||Have you taken a look at http://www.gotreportviewer.com/? There is a sample called "Print a report from a console app" that uses the ReportViewer control to do this.|||

Thanks for the link Brian - this is almost exactly what I need to do (automatically print local reports).

My ADO.NET skills are not quite up to par - how would I modify the Run method of this example to execute an existing server based report that I have? I have managed to convert the report from an RDL to an RDLC, and added it to my Console Project with VB.NET. In addition, I created a new Data Set within this project that returns the data from the original stored procedure that was used for the RDL file. I now need to associate this new Data Set with the RDLC report, as well as pass some parameters to it, but I am not sure how to proceed.

Any suggestions/direction would be greatly appreciated.

Thanks!

Wednesday, March 7, 2012

different searches for web matrix and sql server

Hi Everyone. I have created a procedure on sql to obtain information about two tables ( bookinfo and author). The procedure is :

CREATE PROCEDURE FindBookByAuthor
@.Aname char
AS

select b.libcode, b.title, b.subject, a.authorname, b.instock
from bookinfo b join authorinfo a
on b.authorid = a.authorid
where a.authorname like '%' + @.aname + '%'
GO

I have tested this procedure changing the variable @.aname for the surname of the author. This works fine. The problem comes when I execute this procedure from web matrix. I use a textbox to obtain the data for the variable @.aname. I send the data. What happens is that when I run the web page and look for a book through the author the select statement behaves differently and gives me a different output.

I would be glad to know why this happens

ThanksShow some code. Failing that, verify in SQL Profiler that the SQL/Parameters you think you are executing is in fact what is being executed.|||well, the asp.net code is :
--------------------


Sub Button2_Click(sender As Object, e As EventArgs)
Dim objConn As SqlConnection
Dim dataReader As SqlDataReader
dim constring as string
Dim objCmd As SqlCommand
constring = "server='(local)'; trusted_connection=true; database='dbjaime'"
objConn = New sqlconnection(constring)
dim strsql as string
strsql = "EXECUTE findtitle '" & textboxtitle.text & "'"
objCmd = New SqlCommand(strSQL, objConn)

objConn.Open()
dataReader = objCmd.ExecuteReader()
'Bind to DataGrid
dtgbooks.DataSource = dataReader
dtgbooks.DataBind()

objConn.Close()
objConn.Dispose()
End Sub
--------------------


Where "findtitle" is a procedure I showed you before.|||Use SQL Profiler and see if what you are sending is what you think you are in both cases (where it works and where it does not).|||I have tried to use the sql profiler, which I had never used before. It shows me the last executions. Then I have loaded my web page and execute the event "button click" I send you before. Now what I see on the sql profile is:

exec sp_executesql N'EXECUTE findtitle ''design'''

among other stuff. I this what I should get?|||The findtitle line is what I was having you look for.

Execute the code in the way that it works, as well as the way that it does not work, and compare what appears in SQL Profiler. You are saying running the code with Web Matrix produces different results. I am looking to have you isolate exactly why the results are different.|||ok. I'll take a look. Thanks for being so quick.|||I'm not sure if I'm passing the parameters correctly to the procedure findtitle on the line:

strsql = "EXECUTE findtitle ' " & txt1.text & " ' "

I say that they give me different results because when I copy the select statement from the procedure into the SQL analyzer I subtitute the variabe @.btitle for a word such as 'database'. And then, when I execute the web page I insert in the textbox the word database.

am I doing something wrong?

Thanks

Saturday, February 25, 2012

Different language Characters

I have a developer that needs to store different language
characters in a table. What he is doing is designing a web
page, so that someone will have a choice as what language
he will view the web page in. Is it possible to store lets
say Russian or Chinese characters in a SQL Server table?
Does this fall under Unicode data? If you can do this, how
do you get the characters into the coulmns? Any help or
suggestions would be greatly appreciated!!Hello Richard !
Yes, this is UNICODE. How you get the data into the columns ? With an INSERT
? Regardless , your business logic
is on SQL Server or in the frontend, the data is send to SQL Server in
UNICODE and also stored there as this.
Jens Süßmeyer.
"Richard" <richard.peoples@.lacdc.org> schrieb im Newsbeitrag
news:034301c365ce$cce23130$a501280a@.phx.gbl...
> I have a developer that needs to store different language
> characters in a table. What he is doing is designing a web
> page, so that someone will have a choice as what language
> he will view the web page in. Is it possible to store lets
> say Russian or Chinese characters in a SQL Server table?
> Does this fall under Unicode data? If you can do this, how
> do you get the characters into the coulmns? Any help or
> suggestions would be greatly appreciated!!|||Obviously then, I need to have SQL Server installed as Unicode. Correct?
>--Original Message--
>Hello Richard !
>Yes, this is UNICODE. How you get the data into the columns ? With an INSERT
>? Regardless , your business logic
> is on SQL Server or in the frontend, the data is send to SQL Server in
>UNICODE and also stored there as this.
>Jens S=FC=DFmeyer.
>
>"Richard" <richard.peoples@.lacdc.org> schrieb im Newsbeitrag
>news:034301c365ce$cce23130$a501280a@.phx.gbl...
>> I have a developer that needs to store different language
>> characters in a table. What he is doing is designing a web
>> page, so that someone will have a choice as what language
>> he will view the web page in. Is it possible to store lets
>> say Russian or Chinese characters in a SQL Server table?
>> Does this fall under Unicode data? If you can do this, how
>> do you get the characters into the coulmns? Any help or
>> suggestions would be greatly appreciated!!
>
>.
>|||No just change the columns you have to NVARCHAR to store UNICODE. But
remeber --> The Maximum Length will be chopped to 4000 characters.
Jens Süßmeyer.

Friday, February 24, 2012

Different header in HTML vs. PDF?

I have a report that is being displayed as a web page, and I've also
got a "Printer-friendly" button to call the same report generates as a
PDF. However, due to the business needs of the application, we need to
add an additional footer with copyright information to the bottom of
each page in the PDF version, but not display it when it's being viewed
as a web page (since it will be viewed in an IFRAME).
I've seen that the Visibility property of a section can be an
expression, so what I'm thinking is that I could use something along
the lines of =Iif(format="PDF", true, false) for the Visibility of the
footer, so it will show up when the passed-in "Format" parameter is
"PDF", but not when it's "HTML4.0". However, I'm not sure how to
access this parameter, or even whether or not I am able to.
Is there a way to access this value? Or will I have to make two
different reports, one with a footer and one without?
Thanks,
David HendersonThe second option is the best one.
Amarnath
"David Henderson" wrote:
> I have a report that is being displayed as a web page, and I've also
> got a "Printer-friendly" button to call the same report generates as a
> PDF. However, due to the business needs of the application, we need to
> add an additional footer with copyright information to the bottom of
> each page in the PDF version, but not display it when it's being viewed
> as a web page (since it will be viewed in an IFRAME).
> I've seen that the Visibility property of a section can be an
> expression, so what I'm thinking is that I could use something along
> the lines of =Iif(format="PDF", true, false) for the Visibility of the
> footer, so it will show up when the passed-in "Format" parameter is
> "PDF", but not when it's "HTML4.0". However, I'm not sure how to
> access this parameter, or even whether or not I am able to.
> Is there a way to access this value? Or will I have to make two
> different reports, one with a footer and one without?
> Thanks,
> David Henderson
>

Sunday, February 19, 2012

Different collations on a single server

I have 2 sql server databases on a single server and each database working with a web site written with VBScript. One database with a collation of SQL_Latin1_General_CP1254_CI_AS and another databse with a collation of SQL_Latin1_General_CP850_CI_AS. Because of the server's windows character setting which is set to "English" the web site working with "CP850" displays NVARCHAR characters correctly, but the web site with "CP1254" displays some of the special turkish NVARCHAR characters not correctly. How can I solve this problem? Note : Query Analyzer displays the characters correctly on the database with a collation of "1254"Did you set Session.CodePage or the CodePage server-side directive to
tell IIS to encode outgoing strings as Unicode, and set the META CHARSET
property to tell the client browser to decode the page as Unicode?
Here's some simple ASP code that demonstrates how to round-trip Unicode
data from arbitrary languages from web browser->IIS->ASP->SQL and back
out to the browser:
http://groups.google.com/groups?q=bartd+asp&hl=en&lr=&ie=UTF-8&selm=JrIV8D
ZDDHA.2496%40cpmsftngxa06.phx.gbl&rnum=1
If this line wraps, try this shorter URL:
http://tinyurl.com/2zygn
Try this out -- it should work if you're using IIS 5 (Windows 2000) or
later. The only thing you should need to change is the connection string
(strCnn) in SQLNLS_UTF8.ASP to point to your SQL Server and provide a
valid login/password.
HTH,
Bart
--
Bart Duncan
Microsoft SQL Server Support
Please reply to the newsgroup only - thanks.
This posting is provided "AS IS" with no warranties, and confers no
rights.
Thread-Topic: Different collations on a single server
thread-index: AcPww2+N7ky8j5FoSwCPaUe5Q6LzGg==X-Tomcat-NG: microsoft.public.sqlserver.server
From: "=?Utf-8?B?bWFocnV0aQ==?=" <anonymous@.discussions.microsoft.com>
Subject: Different collations on a single server
Date: Wed, 11 Feb 2004 09:21:07 -0800
Lines: 1
Message-ID: <FCBF0A2A-02A5-447E-890F-5DD52D4A550D@.microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.sqlserver.server
Path: cpmsftngxa07.phx.gbl
Xref: cpmsftngxa07.phx.gbl microsoft.public.sqlserver.server:328749
NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
X-Tomcat-NG: microsoft.public.sqlserver.server
I have 2 sql server databases on a single server and each database
working with a web site written with VBScript. One database with a
collation of SQL_Latin1_General_CP1254_CI_AS and another databse with a
collation of SQL_Latin1_General_CP850_CI_AS. Because of the server's
windows character setting which is set to "English" the web site working
with "CP850" displays NVARCHAR characters correctly, but the web site
with "CP1254" displays some of the special turkish NVARCHAR characters
not correctly. How can I solve this problem? Note : Query Analyzer
displays the characters correctly on the database with a collation of
"1254"

Different collations on a single server

I have 2 sql server databases on a single server and each database working w
ith a web site written with VBScript. One database with a collation of SQL_L
atin1_General_CP1254_CI_AS and another databse with a collation of SQL_Latin
1_General_CP850_CI_AS. Beca
use of the server's windows character setting which is set to "English" the
web site working with "CP850" displays NVARCHAR characters correctly, but th
e web site with "CP1254" displays some of the special turkish NVARCHAR chara
cters not correctly. How ca
n I solve this problem? Note : Query Analyzer displays the characters correc
tly on the database with a collation of "1254"Did you set Session.CodePage or the CodePage server-side directive to
tell IIS to encode outgoing strings as Unicode, and set the META CHARSET
property to tell the client browser to decode the page as Unicode?
Here's some simple ASP code that demonstrates how to round-trip Unicode
data from arbitrary languages from web browser->IIS->ASP->SQL and back
out to the browser:
http://groups.google.com/groups?q=b...F-8&selm=JrIV8D
ZDDHA.2496%40cpmsftngxa06.phx.gbl&rnum=1
If this line wraps, try this shorter URL:
http://tinyurl.com/2zygn
Try this out -- it should work if you're using IIS 5 (Windows 2000) or
later. The only thing you should need to change is the connection string
(strCnn) in SQLNLS_UTF8.ASP to point to your SQL Server and provide a
valid login/password.
HTH,
Bart
--
Bart Duncan
Microsoft SQL Server Support
Please reply to the newsgroup only - thanks.
This posting is provided "AS IS" with no warranties, and confers no
rights.
Thread-Topic: Different collations on a single server
thread-index: AcPww2+N7ky8j5FoSwCPaUe5Q6LzGg==
X-Tomcat-NG: microsoft.public.sqlserver.server
From: "examnotes" <anonymous@.discussions.microsoft.com>
Subject: Different collations on a single server
Date: Wed, 11 Feb 2004 09:21:07 -0800
Lines: 1
Message-ID: <FCBF0A2A-02A5-447E-890F-5DD52D4A550D@.microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.sqlserver.server
Path: cpmsftngxa07.phx.gbl
Xref: cpmsftngxa07.phx.gbl microsoft.public.sqlserver.server:328749
NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
X-Tomcat-NG: microsoft.public.sqlserver.server
I have 2 sql server databases on a single server and each database
working with a web site written with VBScript. One database with a
collation of SQL_Latin1_General_CP1254_CI_AS and another databse with a
collation of SQL_Latin1_General_CP850_CI_AS. Because of the server's
windows character setting which is set to "English" the web site working
with "CP850" displays NVARCHAR characters correctly, but the web site
with "CP1254" displays some of the special turkish NVARCHAR characters
not correctly. How can I solve this problem? Note : Query Analyzer
displays the characters correctly on the database with a collation of
"1254"