Showing posts with label contains. Show all posts
Showing posts with label contains. Show all posts

Monday, March 26, 2012

How to apply style sheet to report... help me

hai...

i have designed a static rdl file which contains 10 columns.. now when i run the report, how to apply style sheet to the report...i want to apply style sheet at run time.. how to do that..? help me..

Thanks in advance..

If you are using rdlc in Visual Studio 2005, In my observations I think there's no way that you can apply style sheets to rdlc but you can apply CSS in Report Viewer control that contains your rdlc.

Wednesday, March 21, 2012

How to allow apostrophes in string parameters

I have a few reports that contain a customer name parameter. I have
just realized that when a customer name contains a single-quote
(apostrophe), reporting services thinks that it's an unclosed string
and I receive an error.
The error I get -
"An error has occurred during report processing.
Query execution failed for data set '....'.
Line 1: Incorrect syntax near 's'.
Unclosed quotation mark before the character string"."
I know that I probably need to 'escape' the single quote, but I am
unclear if I can do this on the data tab in report designer or if I
have to do this through my views/stored procs in sql server. After
determining where to make the change, I will also need to know what
the correct syntax is.
Thanks so much for your help.
CrystalOn Feb 14, 11:59=A0am, Just Another Reporter <Crystal.War...@.gmail.com>
wrote:
> I have a few reports that contain a customer name parameter. =A0I have
> just realized that when a customer name contains a single-quote
> (apostrophe), reporting services thinks that it's an unclosed string
> and I receive an error.
> The error I get -
> "An error has occurred during report processing.
> Query execution failed for data set '....'.
> Line 1: Incorrect syntax near 's'.
> Unclosed quotation mark before the character string"."
> I know that I probably need to 'escape' the single quote, but I am
> unclear if I can do this on the data tab in report designer or if I
> have to do this through my views/stored procs in sql server. =A0After
> determining where to make the change, I will also need to know what
> the correct syntax is.
> Thanks so much for your help.
> Crystal
Go to the Data tab, and click the Properties button [...] for the
Dataset. Under the Parameters tab, you will see mappings between the
parameters used in the dataset, mapped to the Report Parameters. Note
that these are expressions, so you can put your own code in here to
"escape" the single quote.
What you will want to do is do is something like:
@.Pararm =3DReplace( Parameters!Param.Value, "'", "''" )
-- Scott

Wednesday, March 7, 2012

How to add an "if then else" condition within an expression?

Greetings:

I am creating a complex expression in a Send Mail Task for the MessageSource. The expression contains the values of many package variables. I want to conditionally include some variables in the expression depending on what value they contain.

Is it possible to create conditional logic (if then else) within an expression? I've got to conditionally include 8 different variables.

Thanks,

BCB

Using the expression editor, you can look at the Operators. One of them is the "conditional."

This is what you want. (? Smile

your test ? if true : else false|||

Thanks, Phil.

This is part of the code I came up with to conditionally include "lines" in the body of my email message. The 2nd and 4th lines will appear only if the value of a variable is not empty. (Those are the lines that begin with Trim.) The key thing I discovered is that you need to enclose the conditional logic in parens in order for the overall expression to evaluate properly.

"The number of ESHL rows inserted was " + (DT_STR, 10, 1252) @.[User::ESHL_RowsInserted] + "." + "\n" +
(Trim(@.[User::ESHL_Error_LongMessage]) == "" ? "" : "\n" + "ESHL Message: " + @.[User::ESHL_Error_LongMessage] + "\n\n") +
"The number of Gulf States rows inserted was " + (DT_STR, 10, 1252) @.[User::GulfStates_RowsInserted] + "." + "\n" +
(Trim(@.[User::GulfStates_Error_LongMessage]) == "" ? "" : "\n" + "Gulf States Message: " + @.[User::GulfStates_Error_LongMessage] + "\n\n")

Friday, February 24, 2012

How to add a field containing HTML to be properly rendered

I have a database notes field, which contains the text with some html
elements (fonts, styles, etc). If I add it to the report all html tags come
in plain text. Is there a way to render the field text as html? If not is
there a simple way to strip off all html tags?There is not a way to show as html. To strip off the html I believe there is
a framework function that you could use. Set the value of the textbox to an
expression like this:
= Code.StripHTML(Fields!Fieldname.value)
You would write the function StripHTML that would return the value with the
html striped.
This link shows how to do this using regular expressions.
http://weblogs.asp.net/rosherove/archive/2003/05/13/6963.aspx
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Alex Ch" <Alex Ch@.discussions.microsoft.com> wrote in message
news:ADDDE0F6-2DD0-49EC-875B-99694EB61BC0@.microsoft.com...
>I have a database notes field, which contains the text with some html
> elements (fonts, styles, etc). If I add it to the report all html tags
> come
> in plain text. Is there a way to render the field text as html? If not is
> there a simple way to strip off all html tags?