Showing posts with label inside. Show all posts
Showing posts with label inside. Show all posts

Monday, March 26, 2012

Replace string inside value

Hi all, i have a question, i'm making a report in visual studio, where
i have a textbox which i fill with a value from a database and i wanna
know how you can change certain strings withing the filled value...
example:
This is the expression for the textbox:
=First(Fields!MyFieldName.Value, "Parametri")
=Replace(Fields!MyFieldName.Value.ToString(), "date", "current date")
So, the thing is, i've filled my textbox with a value from a database,
which is in my case, the value is a simple sentence...which has a word
'date' in it...so my question is how can i search that value
(sentence) and find the word "date" and replace it with something, for
example, today's date..?
That means if my textbox value is "bla bla bla date bla bla bla", i
wanna be able to change the word "date" to today's date or any other
word...so that in the report preview instead of "date" it says today's
date...
THANX!On Jun 28, 4:23 am, ApeX <mmo...@.gmail.com> wrote:
> Hi all, i have a question, i'm making a report in visual studio, where
> i have a textbox which i fill with a value from a database and i wanna
> know how you can change certain strings withing the filled value...
> example:
> This is the expression for the textbox:
> =First(Fields!MyFieldName.Value, "Parametri")
> =Replace(Fields!MyFieldName.Value.ToString(), "date", "current date")
> So, the thing is, i've filled my textbox with a value from a database,
> which is in my case, the value is a simple sentence...which has a word
> 'date' in it...so my question is how can i search that value
> (sentence) and find the word "date" and replace it with something, for
> example, today's date..?
> That means if my textbox value is "bla bla bla date bla bla bla", i
> wanna be able to change the word "date" to today's date or any other
> word...so that in the report preview instead of "date" it says today's
> date...
> THANX!
What you have is pretty close to correct. You should be able to use
something like this:
=Replace(CStr(Fields!MyFieldName.Value), "date", "current date") -or-
if you want the actual date time, you could use:
=Replace(CStr(Fields!MyFieldName.Value), "date", CStr(Now()))
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant

Tuesday, March 20, 2012

Replace <br> tag in CRLF

Hi all,

I made a migration operation and when I am looking inside database I can see the <BR> tags.

The question is how to write a query that replace all of this occurances of <BR> inside the colum table, with CLRF which is a new line code.

Thanks in advance.

REPLACE(my_string_field, '<br>', chr(13) + chr(10)) will do the replace in a field...so maybe a query like this would work?

UPDATE MY_TABLE
SET MY_STRING_FIELD = REPLACE(MY_STRING_FIELD, '<br>', chr(13) + chr(10));

give or take|||

We are close but not yet. I needded to change the code so it will work.

The conversion is working but all the characters become question mark like this: "?? ? ?? ?? ?? ?? ???? ? ?? ?"

I tried 2 types of the unicode that one of them should be the one I am using, but still the quotation marks is there...here is the query please help:

UPDATE [E:\WEBSITES\A1\TBH_WEB\APP_DB.MDF].[dbo].[tbh_Comments]
SET
[Body] =REPLACE((CAST([Body]AS varChar(1000)) COLLATE SQL_Latin1_General_CP1_CI_AS),'<br>',char(13) +char(10))

Friday, March 9, 2012

Repeat Header? Anyone can solve it?

Problem 1:
Can anyone let me know how can I set a Fields!value inside the textbox in the header?
I have try to assign a value into the header textbox =ReportItems!textbox1.Value (where textbox1 is inside body of the repeat and hide it)
It works on Page 1 header, however, it shows nothing in Page 2 header.
------
Problem 2:
How can set the table header display on every page? It is not working although I install Reporting Service SP2 and also set the table header RepeatOnNewPage=true...
Can anyone let me know how to solve the problem please?I have the same problem as the first one above - anyone having a solution for this ?
BR
//Peter
|||Found a solution at last ...
http://support.microsoft.com/newsgroups/newsReader.aspx?dg=microsoft.public.sqlserver.reportingsvcs&mid=0cddca0c-47b3-4e6f-8a96-3b698ecbca5a

Monday, February 20, 2012

Rendering URL in EXCEL format

Hi Everyone,
I am trying to diaply my report on the web form by pasting the URL
in ReportViewer1.ReportPath = " " inside the codes. My URL is
/web
Test/FirstReport&rs:Command=Render&rs:Format=HTML4.0&rc:Toolbar=false
It is working fine and diaplying the report, but when I change the
Format to Excel. It does not display the report properly. It gives me
an error that report cannot be found. Same thing with PDF, when I
change the format to PDF. IT gives me the same error.
"There was error opening the file. File does not exist". In excel
format if I save the file. The file is saved but when I want to open
the file from save/open dialog box it does not display properly.
Can anyone please let me know what the problem is.
Thanks,

Hi,

Excel rendering has been a problem since the Reporting Services is used.

With the retail version some versions was not supported. SP1 added some new supported versions. And SP2 is adding more.

You may be running into such a problem.

SP2 will support Excel 97 and later versions.

SP1 supports Excel 10 (Office 2002) or later

Eralper

http://www.kodyaz.com

Rendering Reports to Web Application Interactive Features

I installed RS on a Windows 2003 Server: [Unicube] (inside our network, not
available to internet users).
(Windows Authentication now but can be change to Form authentication)
To let outside users to view the report through internet, I create a asp.net
page to render the report: [Product Line Sales]
You can see here:
http://207.14.208.161/UnicareReport/frmImage.aspx
There is a linked report [Employee Sales Summary]: when click the [Employee
Name], ie [Jang, Stephen] in the above report, it should go to the linked
report: [Employee Sales Summary].
The problem is:
(1) How to also render the linked report in asp.net pages to allow internet
users click the [Employee Name] in the above report to go to the linked
report?
(2) The real problem is: How to pass the parameter value in the report
[Product Line Sales] (ie, enp id=20, etc) in the asp.net page to go to the
linked report [Employee Sales Summary].
(it's easy to do in the report designer in VS 2003: jump to URL or Report:
but the linked report in the report server [Unicube] is not availablre to
internet users).I found the solution:
http://207.14.208.161/UnicareReport/frmImage.aspx
You can click the Employee Name such as [Caro, Fernando],[Ito, Shu] to view
the linked report.
My solution is:
(1) First render the first report [Product Line Sales] on the web use render
method:
(You can see the code on RS BOOK ONLINE: ReportingService.Render Method
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_ref_soapapi_service_lz_6x0z.asp )
For my example, the report rendered on The ASP.Net page frmImage.aspx
(2) Change the [jumpe to report] to [Jump to URL] in report [Product Line
Sales]
then deploy the report on Report Server:
For my example, the [jump to URL] Code is:
="http://207.14.208.161/UnicareReport/ESS.aspx?EmpID="&Fields!EmployeeID.Value
&""
(You need to change it to your web site domain/directory setting)
(3)Render the linked report [Product Line Sales] on the web use render
method
You have to render the 2 linked report [Employee Sales Summary] on webpage:
My ASP.net page is ESS.aspx:
Note:
To pass the parameter you can use request.querystring method, for example,
' Prepare report parameter.
Dim parameters(2) As ParameterValue
Dim EMPIDV As String
EMPIDV = Request.QueryString("EmpID")
parameters(0) = New ParameterValue
parameters(0).Name = "EmpID"
parameters(0).Value = EMPIDV
parameters(1) = New ParameterValue
parameters(1).Name = "ReportMonth"
parameters(1).Value = "6" ' June
parameters(2) = New ParameterValue
parameters(2).Name = "ReportYear"
parameters(2).Value = "2004"
"John Chen" <jchen@.uneriercarecorp.com> wrote in message
news:ewjry75tEHA.2072@.tk2msftngp13.phx.gbl...
>I installed RS on a Windows 2003 Server: [Unicube] (inside our network, not
>available to internet users).
> (Windows Authentication now but can be change to Form authentication)
> To let outside users to view the report through internet, I create a
> asp.net page to render the report: [Product Line Sales]
> You can see here:
> http://207.14.208.161/UnicareReport/frmImage.aspx
> There is a linked report [Employee Sales Summary]: when click the
> [Employee Name], ie [Jang, Stephen] in the above report, it should go to
> the linked report: [Employee Sales Summary].
> The problem is:
> (1) How to also render the linked report in asp.net pages to allow
> internet users click the [Employee Name] in the above report to go to the
> linked report?
> (2) The real problem is: How to pass the parameter value in the report
> [Product Line Sales] (ie, enp id=20, etc) in the asp.net page to go to the
> linked report [Employee Sales Summary].
> (it's easy to do in the report designer in VS 2003: jump to URL or Report:
> but the linked report in the report server [Unicube] is not availablre to
> internet users).
>
>|||Correct:
(3)Render the linked report [Employee Sales Summary] on another webpage:
My ASP.net page is ESS.aspx:
Note:
To pass the parameter you can use request.querystring method, for example,
' Prepare report parameter.
Dim parameters(2) As ParameterValue
Dim EMPIDV As String
EMPIDV = Request.QueryString("EmpID")
parameters(0) = New ParameterValue
parameters(0).Name = "EmpID"
parameters(0).Value = EMPIDV
parameters(1) = New ParameterValue
parameters(1).Name = "ReportMonth"
parameters(1).Value = "6" ' June
parameters(2) = New ParameterValue
parameters(2).Name = "ReportYear"
parameters(2).Value = "2004"
"John Chen" <jchen@.uneriercarecorp.com> wrote in message
news:eJWU8JEuEHA.348@.tk2msftngp13.phx.gbl...
>I found the solution:
> http://207.14.208.161/UnicareReport/frmImage.aspx
> You can click the Employee Name such as [Caro, Fernando],[Ito, Shu] to
> view the linked report.
> My solution is:
> (1) First render the first report [Product Line Sales] on the web use
> render method:
> (You can see the code on RS BOOK ONLINE: ReportingService.Render Method
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_ref_soapapi_service_lz_6x0z.asp )
> For my example, the report rendered on The ASP.Net page frmImage.aspx
> (2) Change the [jumpe to report] to [Jump to URL] in report [Product Line
> Sales]
> then deploy the report on Report Server:
> For my example, the [jump to URL] Code is:
> ="http://207.14.208.161/UnicareReport/ESS.aspx?EmpID="&Fields!EmployeeID.Value
> &""
> (You need to change it to your web site domain/directory setting)
> (3)Render the linked report [Product Line Sales] on the web use render
> method
> You have to render the 2 linked report [Employee Sales Summary] on
> webpage:
> My ASP.net page is ESS.aspx:
> Note:
> To pass the parameter you can use request.querystring method, for example,
> ' Prepare report parameter.
> Dim parameters(2) As ParameterValue
> Dim EMPIDV As String
> EMPIDV = Request.QueryString("EmpID")
> parameters(0) = New ParameterValue
> parameters(0).Name = "EmpID"
> parameters(0).Value = EMPIDV
> parameters(1) = New ParameterValue
> parameters(1).Name = "ReportMonth"
> parameters(1).Value = "6" ' June
> parameters(2) = New ParameterValue
> parameters(2).Name = "ReportYear"
> parameters(2).Value = "2004"
>
> "John Chen" <jchen@.uneriercarecorp.com> wrote in message
> news:ewjry75tEHA.2072@.tk2msftngp13.phx.gbl...
>>I installed RS on a Windows 2003 Server: [Unicube] (inside our network,
>>not available to internet users).
>> (Windows Authentication now but can be change to Form authentication)
>> To let outside users to view the report through internet, I create a
>> asp.net page to render the report: [Product Line Sales]
>> You can see here:
>> http://207.14.208.161/UnicareReport/frmImage.aspx
>> There is a linked report [Employee Sales Summary]: when click the
>> [Employee Name], ie [Jang, Stephen] in the above report, it should go to
>> the linked report: [Employee Sales Summary].
>> The problem is:
>> (1) How to also render the linked report in asp.net pages to allow
>> internet users click the [Employee Name] in the above report to go to the
>> linked report?
>> (2) The real problem is: How to pass the parameter value in the report
>> [Product Line Sales] (ie, enp id=20, etc) in the asp.net page to go to
>> the linked report [Employee Sales Summary].
>> (it's easy to do in the report designer in VS 2003: jump to URL or
>> Report: but the linked report in the report server [Unicube] is not
>> availablre to internet users).
>>
>>
>