Monday, March 26, 2012
How do I keep the SQL Statement readable
an SQL statement readable.
I go through all the trouble of writing the statement keeping it nice and
neat, then VS combines it all into one lump of code. This makes editing it
later difficult.Use the generic query window (two pane) instead of the default graphical
query window (4 pane). To switch over to the generic there is a button to
the right of the ...
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"David" <David@.discussions.microsoft.com> wrote in message
news:D4BFC88D-D107-4F49-8125-7F750FC60A4C@.microsoft.com...
> Is there a way to prevent VS from collapsing the formatting that I do to
> keep
> an SQL statement readable.
> I go through all the trouble of writing the statement keeping it nice and
> neat, then VS combines it all into one lump of code. This makes editing it
> later difficult.
Friday, February 24, 2012
How Do I embed a RegEx in a Report Model
Here is my attempt at the expression I want:
=IF((System.Text.RegularExpressions.Regex.IsMatch(PreferedEmail)),True,False)
The error returned when I attempt to save the expression in Report Model Designer is "The following is character is not valid: ."
BTW, the message is copied verbatim. The poor grammer is not my fault.
I take it that no news is very bad news on this front. There is no way to reference a static .NET method/object in a Report Model expression. That's a real shame.
|||
Kevin,
You can use regular expression in reporting services for example:
=System.Text.RegularExpressions.Regex.Replace(Fields!Phone.Value, "(\d{3})[ -.]*(\d{3})[ -.]*(\d{4})", "($1) $2-$3")
Hammer
|||I'm going to go out on a limb here & guess that you've never tried that in a Report Model (SDML). You absolutely can do that in an expression embedded in a Report Definition (RDL). But the Report Model Designer will not allow you to save the expression.|||You are correct -- referencing .NET methods from a report model expression is not supported. Depending on the report the user creates, report model expressions can potentially end up translated into SQL or MDX and embedded deep in some database query.
If you have VS and you're just using the expression as a surface expression in a particular report, you might save your report out as a file, load it up in Report Designer, and then add the expression there. I realize this doesn't give you anything in the model, however.
|||It's not the answer I wanted but now I understand why I can't have what I want. Thanks for the explanation.How Do I embed a RegEx in a Report Model
Here is my attempt at the expression I want:
=IF((System.Text.RegularExpressions.Regex.IsMatch(PreferedEmail)),True,False)
The error returned when I attempt to save the expression in Report Model Designer is "The following is character is not valid: ."
BTW, the message is copied verbatim. The poor grammer is not my fault.I take it that no news is very bad news on this front. There is no way to reference a static .NET method/object in a Report Model expression. That's a real shame.|||
Kevin,
You can use regular expression in reporting services for example:
=System.Text.RegularExpressions.Regex.Replace(Fields!Phone.Value, "(\d{3})[ -.]*(\d{3})[ -.]*(\d{4})", "($1) $2-$3")
Hammer
|||I'm going to go out on a limb here & guess that you've never tried that in a Report Model (SDML). You absolutely can do that in an expression embedded in a Report Definition (RDL). But the Report Model Designer will not allow you to save the expression.|||
You are correct -- referencing .NET methods from a report model expression is not supported. Depending on the report the user creates, report model expressions can potentially end up translated into SQL or MDX and embedded deep in some database query.
If you have VS and you're just using the expression as a surface expression in a particular report, you might save your report out as a file, load it up in Report Designer, and then add the expression there. I realize this doesn't give you anything in the model, however.
|||It's not the answer I wanted but now I understand why I can't have what I want. Thanks for the explanation.