Showing posts with label own. Show all posts
Showing posts with label own. Show all posts

Friday, March 23, 2012

Replace Parameter Toolbar with a Custom Toolbar

Someone told me I could replace the parameter toolbar with my own custom
toolbar. How do you create/use a custom toolbar?Hi JrMcG,
Thank you for your posting!
Based on my scope, I don think you could replace the parameter toolbar
directly in reporting services.
The parameter toolbar is the default browser behavior and the report viewer
does not expose a way to override it.
Also, I found that you have submit another post about the conditionally
load drop down in parameter toolbar. I replied that issue in that thread. I
wonder does that issue the main concern from you. Please let me know the
result. Thank you!
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi JrMcG,
Have you got any chance to check the suggestion I provided? Please feel
free to let me know if you need any help! Thank you!
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Yes I think I am OK. I went with loading all parameters with valid values,
forcing user to pick something valid thus not needing custom toolbar.
However, we are reading in other places that a custom tollbar can be done.
Thanks for your help.
"Wei Lu [MSFT]" <weilu@.online.microsoft.com> wrote in message
news:j38shYknGHA.2024@.TK2MSFTNGXA01.phx.gbl...
> Hi JrMcG,
> Have you got any chance to check the suggestion I provided? Please feel
> free to let me know if you need any help! Thank you!
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>|||Hi JrMcg,
Glad to hear you resolved this issue. Based on my research, there is not
any Microsoft Offical document places that you could customize the
parameter toolbar. You could hide the report toolbar when you render, but I
don't find any document placed the customization of the parameter toolbar.
If you have any questions, please feel free to let me know.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.sql

replace maintanance plan optimization

hello i have the following question: i want to replace maintanance plan
with my own scripts and when i examine in profiler sql running during
optimization i see dbcc dbreindex command with sorted_data_reorg clause,
which according to BOL is 6.x feature and is no longer available in SQL
Server 2000. what kind of dbreindex syntax should i use?
example
dbcc dbreindex(N'[dbo].[table]', N'', 85, sorted_data_reorg)
thanks a lot for reply. mojza
--
Posted via http://dbforums.comJust ignore that clause. Use DBCC like BOL has it referenced.
--
Andrew J. Kelly
SQL Server MVP
"mojza" <member12685@.dbforums.com> wrote in message
news:3061295.1057051503@.dbforums.com...
> hello i have the following question: i want to replace maintanance plan
> with my own scripts and when i examine in profiler sql running during
> optimization i see dbcc dbreindex command with sorted_data_reorg clause,
> which according to BOL is 6.x feature and is no longer available in SQL
> Server 2000. what kind of dbreindex syntax should i use?
> example
> dbcc dbreindex(N'[dbo].[table]', N'', 85, sorted_data_reorg)
>
> thanks a lot for reply. mojza
> --
> Posted via http://dbforums.com

Wednesday, March 21, 2012

REPLACE Integers with Text Data

I am working with a database named “Documents” that contains 4 categories of text documents, each having its own number designation in an integer datatype column named SectionTypeId:

1 = Text

2 = Report

3 = Background

4 = Index

I would like to create a new column named “DocType” in which the integer data type for each document is replaced with a varchar data type letter (1 = T, 2 = R, 3 = B, 4 = I).I was able to easily create the new column and cast the data type from integer to varchar:

--CREATE NEW COLUMN “DocType” WITH VARCHAR DATATYPE

ALTER TABLE FullDocuments ADD DocType VARCHAR(1) NULL

Go

--UPDATE NEW COLUMN WITH CAST STRING

UPDATE FullDocuments SET DocType = CAST(SectionTypeID AS VARCHAR(1))

Go

But I have problems with the REPLACE method for replacing the numbers with letters.First I tried this based on the examples in MSDN Library:

--REPLACE NUMBERS WITH LETTERS

UPDATE Fulldocuments REPLACE (DocType,"1","T")

Which produced an error message: “Incorrect syntax near 'REPLACE'.”

Thinking that the datatype may be the problem, I tried this to convert to DT_WSTR data type prior to replace:

UPDATE Fulldocuments REPLACE ((DT_WSTR,1)DocType,"1","T")

Which produced the same error message: “Incorrect syntax near 'REPLACE'.”

I have never done a REPLACE before, so any suggestions for accomplishing this would be appreciated.

Your UPDATE statement syntax is incorrect. And the 2nd syntax where you are trying to cast to DT_WSTR is not a valid SQL syntax also. See SQL Server Books Online for the complete UPDATE statement syntax and examples. UPDATE statement consists of SET, FROM and WHERE clauses. You are missing the SET clause. And you should use single-quotes preferably for string literals otherwise you will get errors most of the time depending on your SET options. Modify your update statement to:

UPDATE Fulldocuments SET DocType = REPLACE (DocType,'1','T')

But it doesn't seem like you want to create this DocType column in the first place. You should create a separate lookup table that contains the ids and description or type. You can then join with that table based on your ID value to get the description. This is much more flexible approach that doing it your way.

|||Thanks for correcting my syntax and the advice about creating a separate lookup table.

Monday, February 20, 2012

RENDERSTREAM - What am I doing wrong?

I'm writing my own app that calls the RS Web Service.
So far, pretty good, but I can't seem to make RENDERSTREAM Work.
Do you have any idea what is wrong with this code?
The error I get is that RenderStream can not find the stream...
RenderedReport = myReportService.Render
(myReport, Format, HistoryID, DeviceInfo, myParameters, Credentials,
ShowHideToggle, Encoding, MimeType, UsedParameters, Warnings, StreamIDs)
For Each streamid As String In StreamIDs
RenderedStreams = myReportService.RenderStream _
(myReport, Format, streamid, Nothing, Nothing, Nothing,
Nothing, Nothing)
My DEVINFO for the RENDER is
DeviceInfo = "<DeviceInfo>"
DeviceInfo += "<HTMLFragment>True</HTMLFragment>"
DeviceInfo += "<Parameters>False</Parameters>"
DeviceInfo += "<Toolbar>False</Toolbar>"
DeviceInfo += "<StreamRoot>/" + Session("RSFolder") +
"/resources/</StreamRoot>"
DeviceInfo += "</DeviceInfo>"
Thanks.IraD wrote:
> I'm writing my own app that calls the RS Web Service.
> So far, pretty good, but I can't seem to make RENDERSTREAM Work.
> Do you have any idea what is wrong with this code?
> The error I get is that RenderStream can not find the stream...
Ira..
Try this:
Dim result As Byte() = Nothing
Dim image As Byte()
result = rs.Render(path, format, historyID, deviceInfo, parameters, Nothing,
Nothing, encoding, _
mimeType, parametersUsed, warnings, streamIds)
Select Case format
Case "HTML4.0", "HTML3.2"
' render stream for each image and save to disk
Dim stream As System.IO.FileStream
For Each streamid As String In streamIds
Dim encodingImage As String
Dim mimeTypeImage As String
image = rs.RenderStream(path, format, streamid, Nothing, Nothing,
parameters, encodingImage, mimeTypeImage)
stream = System.IO.File.OpenWrite(Server.MapPath("./Temp") & "\" &
streamid)
stream.Write(image, 0, CInt(image.Length))
stream.Close()
Next
Dim enc As System.Text.Encoding = System.Text.Encoding.UTF8
ReportPlaceholder.InnerHtml = enc.GetString(result)
Case Else
Response.ClearContent()
Response.AppendHeader("content-length", result.Length.ToString())
Response.ContentType = mimeType
Response.BinaryWrite(result)
Response.Flush()
Response.Close()
End Select|||Frank,
Much closer. My error was that I did not pass the "parameters" argument
correctly to RENDERSTREAM. I had NOTHING, now that I have sent along the
parameters, renderstream works.
But I don't understand the reportplaceholder.innerhtml statement. What I
now see on my screen is a box that looks like it wants to hold my chart - but
it doesn't have it. Do I have to send the results of renderstream to the
response object as well as the results of the render?
Thanks.
"Frank Matthiesen" wrote:
> IraD wrote:
> > I'm writing my own app that calls the RS Web Service.
> > So far, pretty good, but I can't seem to make RENDERSTREAM Work.
> >
> > Do you have any idea what is wrong with this code?
> > The error I get is that RenderStream can not find the stream...
> Ira..
> Try this:
> Dim result As Byte() = Nothing
> Dim image As Byte()
> result = rs.Render(path, format, historyID, deviceInfo, parameters, Nothing,
> Nothing, encoding, _
> mimeType, parametersUsed, warnings, streamIds)
>
> Select Case format
> Case "HTML4.0", "HTML3.2"
> ' render stream for each image and save to disk
> Dim stream As System.IO.FileStream
> For Each streamid As String In streamIds
> Dim encodingImage As String
> Dim mimeTypeImage As String
> image = rs.RenderStream(path, format, streamid, Nothing, Nothing,
> parameters, encodingImage, mimeTypeImage)
> stream = System.IO.File.OpenWrite(Server.MapPath("./Temp") & "\" &
> streamid)
> stream.Write(image, 0, CInt(image.Length))
> stream.Close()
> Next
> Dim enc As System.Text.Encoding = System.Text.Encoding.UTF8
> ReportPlaceholder.InnerHtml = enc.GetString(result)
> Case Else
> Response.ClearContent()
> Response.AppendHeader("content-length", result.Length.ToString())
> Response.ContentType = mimeType
> Response.BinaryWrite(result)
> Response.Flush()
> Response.Close()
> End Select
>
>|||IraD wrote:
> But I don't understand the reportplaceholder.innerhtml statement.
> What I
> now see on my screen is a box that looks like it wants to hold my
> chart - but it doesn't have it. Do I have to send the results of
> renderstream to the response object as well as the results of the
> render?
PlaceHolder is declared on aspx-page
Send me your mail-adress...i will send you the files with full code.
regards
Frank|||Much appreciated: IDOBROW@.AIB.ORG
"IraD" wrote:
> I'm writing my own app that calls the RS Web Service.
> So far, pretty good, but I can't seem to make RENDERSTREAM Work.
> Do you have any idea what is wrong with this code?
> The error I get is that RenderStream can not find the stream...
> RenderedReport = myReportService.Render
> (myReport, Format, HistoryID, DeviceInfo, myParameters, Credentials,
> ShowHideToggle, Encoding, MimeType, UsedParameters, Warnings, StreamIDs)
> For Each streamid As String In StreamIDs
> RenderedStreams = myReportService.RenderStream _
> (myReport, Format, streamid, Nothing, Nothing, Nothing,
> Nothing, Nothing)
> My DEVINFO for the RENDER is
> DeviceInfo = "<DeviceInfo>"
> DeviceInfo += "<HTMLFragment>True</HTMLFragment>"
> DeviceInfo += "<Parameters>False</Parameters>"
> DeviceInfo += "<Toolbar>False</Toolbar>"
> DeviceInfo += "<StreamRoot>/" + Session("RSFolder") +
> "/resources/</StreamRoot>"
> DeviceInfo += "</DeviceInfo>"
> Thanks.

Rendering to PDF format

Hi everyone!
I have a problem with rendering report to PDF format. I created report using
my own report designer, developed for our company commercial product. There
is no problem to render report to some other format like HTML or IMAGE. But
when I render report to PDF format some of information simply disappears from
result report. There are empty spaces instead of printed values. Are there
any special definitions I have to make to each object, and what are the
different between, for example, HTML and PDF format from SQL reporting
services point of view.
Thanks!
Igor.The same thing is happening to me when I render a report with an embedded
image to pdf. I can either open or save the pdf, but upon reviewing the file
pieces of the report simply disappear. When I click to print, it is
completely blank.
"Igor" wrote:
> Hi everyone!
> I have a problem with rendering report to PDF format. I created report using
> my own report designer, developed for our company commercial product. There
> is no problem to render report to some other format like HTML or IMAGE. But
> when I render report to PDF format some of information simply disappears from
> result report. There are empty spaces instead of printed values. Are there
> any special definitions I have to make to each object, and what are the
> different between, for example, HTML and PDF format from SQL reporting
> services point of view.
> Thanks!
> Igor.