Showing posts with label parameter. Show all posts
Showing posts with label parameter. Show all posts

Thursday, March 29, 2012

Change Location of Logging

What parameter should be changed where in order to send the logging to a separate directory.

THx

Harry,

You can control this by using a "Directory" element in the web.config file for the RS web service and the bin\ReportingtServicesService.exe.config file for the RS Windows service:

default:

<RStrace>
<add name="FileName" value="ReportServer_" />
<add name="FileSizeLimitMb" value="32" />
<add name="KeepFilesForDays" value="14" />
<add name="Prefix" value="tid, time" />
<add name="TraceListeners" value="debugwindow, file" />
<add name="TraceFileMode" value="unique" />
<add name="Components" value="all,RunningJobs:3" />
</RStrace>

custom log file path:

<RStrace>
<add name="FileName" value="ReportServer_" />
<add name="Directory" value="D:\RSTraceData" />
<add name="FileSizeLimitMb" value="32" />
<add name="KeepFilesForDays" value="14" />
<add name="Prefix" value="tid, time" />
<add name="TraceListeners" value="debugwindow, file" />
<add name="TraceFileMode" value="unique" />
<add name="Components" value="all,RunningJobs:3" />
</RStrace>

Note that a folder called "LogFiles" will be created under whatever folder you specify. If the path you specify doesn't exist, it will be created. If there's some problem writing log files to that path, the log files will end up in %Temp%.

BTW, this is a "lightly-documented" feature, so it's subject to change without notice in future versions, and it doesn't get the same level of testing that other more well-documented features get.

Tuesday, March 27, 2012

Change Image using parameter

I need to change the logo on my reports according to a parameter that I pass from VB.NET.

What is the best way to load the image into the report?

I have attempted to use a dataset:

I created a logo field in my dataset
I loaded the correct image in VB.NET
I then assigned the 'logo' field in the dataset to this image

My problem is that I don't know what the data type of the logo field should be - I have created the dataset manually and the images are not in a database.

This is my code:

'Load image into ByteArray
Dim fs As New System.IO.FileStream("C:\temp\test.jpg", IO.FileMode.Open)
Dim nBytes As Integer = fs.Length
Dim ByteArray(nBytes) As Byte
Dim nBytesRead As Integer = fs.Read(ByteArray, 0, nBytes)
fs.Read(ByteArray, 0, Convert.ToInt32(fs.Length.ToString(), 10) - 1)

'Set logo field to this image
Dim tbl As New mySchemas.myDataTable
Dim rw As DataRow = tbl.NewRow
rw("logo") = ByteArray 'AN ERROR OCCURS ON THIS LINE
tbl.Rows.Add(rw)
Dim ds As New DataSet
ds.Tables.Add(tbl)

Is this the best way to do load an image into crystal? If so what should the datatype of the logo field be in the dataset? I tried Byte but that did not work.

Thanks for any help
ElaineElaine,
I'll preface this by saying: I don't use CR10, and don't use .NET with CR.
From your code you are declaring a row object to hold the picture.
Shouldn't you be using a "field" object, or whatever the .NET equivalent is?
Field type should be OLE Object/BLOB(BinaryLargeOBject)/BitStream or similar.

Dave|||Thanks for your reply Dave. All sorted now.

The data type I needed turned out to be 'hexbinary'
Incase anyone has the same problem this is the solution:

Dim data As New DataSet()
Dim row As DataRow

data.Tables.Add("Images")
data.Tables(0).Columns.Add("img", System.Type.GetType("System.Byte[]"))

Dim fs As New FileStream("C:\test.jpg", FileMode.Open)
Dim br As New BinaryReader(fs)

row = data.Tables(0).NewRow()
row(0) = br.ReadBytes(br.BaseStream.Length)
data.Tables(0).Rows.Add(row)

br.close
fs.close

br = Nothing
fs = Nothing

' CrystalReport1 is a strongly typed report created in Visual Studio.
Dim cr As New CrystalReport1()
cr.SetDataSource(data)
CrystalReportViewer1.ReportSource = cr|||Are you using the version of crystal reports that came with visual net??
I create the typed dataset with a field hexBinary and load the pictur there but how can I put that picture in the report it shows as a number and no image apearssql

Change Graph type at run time

Hi
Can the user not change the graph type at run time the same way you can
change for example background colour. I want to have a parameter for the user
so he can choose line, bar or pie for the same graph.
Thanks
FrancoisSetting chart types dynamically is not supported in the current release.
However, you could approximate the desired behavior by using multiple charts
(of various types) and use an expression to dynamically hide all charts but
the one you want displayed.
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Francois" <Francois@.discussions.microsoft.com> wrote in message
news:7CDB8D7C-2444-4C9B-916C-59A2A8946FB2@.microsoft.com...
> Hi
> Can the user not change the graph type at run time the same way you can
> change for example background colour. I want to have a parameter for the
user
> so he can choose line, bar or pie for the same graph.
> Thanks
> Francois

Sunday, March 25, 2012

Change Filename creating database

I wish to change filename parameter depending on the root path of SQL Server :

C:\Program Files\Microsoft SQL Server\MSSQL.X\MSSQL where X>=1

I can find this root path by the following querie :

select SUBSTRING (physical_name,1,len(physical_name)-11) from sys.database_files where type_desc like 'LOG')

But i can't include the result in the create database command to be independant of the new root path in a the case of a deployment :

CREATE DATABASE [ACS] ON PRIMARY
(
NAME = N'ACS',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ACS.mdf',
SIZE = 5120KB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB
)
LOG ON
(
NAME = N'ACS_log',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ACS_log.ldf',
SIZE = 3840KB,
MAXSIZE = 2048GB,
FILEGROWTH = 10%
)

Somebody can help me please ?

You will have to compose your SQlString first, then executing it with the help of sp_executesql or EXEC.

HTH; Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Following your clear but short instruction, i write the next queries that don't work, have a correction ?

DECLARE @.prmname nvarchar(500)
DECLARE @.prmname2 nvarchar(500)
DECLARE @.prmpath nvarchar(500)
DECLARE @.prmpath2 nvarchar(500)
DECLARE @.SQLString nvarchar(500)
DECLARE @.ParmDefinition nvarchar(500);

/* Build the SQL string */
SET @.SQLString =
N'CREATE DATABASE [ACS] ON PRIMARY
(
NAME = @.name,
FILENAME = @.path,
SIZE = 5120KB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB
)
LOG ON
(
NAME = @.name2,
FILENAME = @.path2,
SIZE = 3840KB,
MAXSIZE = 2048GB,
FILEGROWTH = 10%
)
COLLATE Latin1_General_BIN2';
SET @.ParmDefinition = N'@.path varchar(500),@.path2 varchar(500), @.name varchar(500), , @.name2 varchar(500)';

/* Execute the string with the parameter value. */
SET @.prmname = N'ACS';
SET @.prmpath = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ACS.mdf';
SET @.prmname2 = N'ACS_log';
SET @.prmpath2 = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ACS_log.ldf';

EXECUTE sp_executesql
@.SQLString,
@.ParmDefinition,
@.name= @.prmname,@.path=@.prmpath, @.name2= @.prmname2,@.path2=@.prmpath2;

|||

DECLARE @.prmname nvarchar(500)

DECLARE @.prmname2 nvarchar(500)

DECLARE @.prmpath nvarchar(500)

DECLARE @.prmpath2 nvarchar(500)

DECLARE @.SQLString nvarchar(500)

DECLARE @.ParmDefinition nvarchar(500);

/* Execute the string with the parameter value. */

SET @.prmname = N'ACS';

SET @.prmpath = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ACS.mdf';

SET @.prmname2 = N'ACS_log';

SET @.prmpath2 = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ACS_log.ldf';

/* Build the SQL string */

SET @.SQLString =

N'CREATE DATABASE [ACS] ON PRIMARY

(

NAME = ' + @.prmname + ',

FILENAME = ' + @.prmpath + ',

SIZE = 5120KB,

MAXSIZE = UNLIMITED,

FILEGROWTH = 1024KB

)

LOG ON

(

NAME = ' + @.prmname2 + ',

FILENAME = ' + @.prmpath2 + ',

SIZE = 3840KB,

MAXSIZE = 2048GB,

FILEGROWTH = 10%

)

COLLATE Latin1_General_BIN2'

EXECUTE sp_executesql @.SQLString

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

It's not working.

Incorrect Syntax for 'C' for DECLARE @.prmpath2 nvarchar(500)

Thursday, March 22, 2012

Change default input parameter drop down list size

I am working on a report which uses a multi value input parameter. The value
set is depend on the other input parameter, so the size and value are
different when the value of the other parameter has changed. The problem is
sometime it works perfectly, but the other time when there are only two
value, the drop down list will show "Select All" and first item and gives me
a scroll bar. This is very annoying. Anyone know how to make the drop down
list to disply more desirous number of items. In addition, is there a way to
control the parameter text box length?I have the same problem but even a worse scenario. My list is filtered by
another and can end up with only one entry. While two entries at least lets
you scroll through the list ('cause the scroll buttons are shown), a list of
only one value doesn't even show the scroll buttons.
I also need a way to allow/force a list this short to be at least long
enough to show the scrollbars.
Jon

Thursday, March 8, 2012

Change a subreports report source

Is there a way to change a subreports report source on the fly? I would
like to change the report based on a parameter that is passed to the main
report.
Thanks,
TimThere is in 2005. Expression based data sources (this is true for all
reports, not just sub reports).
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/rptsrvr9/html/4d8f0ae1-102b-4b3d-9155-fa584c962c9e.htm
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Tim Kelley" <tkelley@.company.com> wrote in message
news:%23xZLyu6oHHA.2044@.TK2MSFTNGP04.phx.gbl...
> Is there a way to change a subreports report source on the fly? I would
> like to change the report based on a parameter that is passed to the main
> report.
> Thanks,
> Tim
>|||Can I use this method to change the report (not the data) that is used in a
subreport?
Tim
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:ezNYoY8oHHA.4652@.TK2MSFTNGP02.phx.gbl...
> There is in 2005. Expression based data sources (this is true for all
> reports, not just sub reports).
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/rptsrvr9/html/4d8f0ae1-102b-4b3d-9155-fa584c962c9e.htm
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Tim Kelley" <tkelley@.company.com> wrote in message
> news:%23xZLyu6oHHA.2044@.TK2MSFTNGP04.phx.gbl...
>> Is there a way to change a subreports report source on the fly? I would
>> like to change the report based on a parameter that is passed to the main
>> report.
>> Thanks,
>> Tim
>|||Ahhh, that's what you want to do. No, you cannot change which subreport is
called. What most people do in this situation is embed multiple subreports
and then hide and show them depending on conditions. There is a visibility
parameter that you can set to an expression to control this.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Tim Kelley" <tkelley@.company.com> wrote in message
news:ujKjidEpHHA.3644@.TK2MSFTNGP02.phx.gbl...
> Can I use this method to change the report (not the data) that is used in
> a subreport?
> Tim
> "Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
> news:ezNYoY8oHHA.4652@.TK2MSFTNGP02.phx.gbl...
>> There is in 2005. Expression based data sources (this is true for all
>> reports, not just sub reports).
>> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/rptsrvr9/html/4d8f0ae1-102b-4b3d-9155-fa584c962c9e.htm
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "Tim Kelley" <tkelley@.company.com> wrote in message
>> news:%23xZLyu6oHHA.2044@.TK2MSFTNGP04.phx.gbl...
>> Is there a way to change a subreports report source on the fly? I would
>> like to change the report based on a parameter that is passed to the
>> main report.
>> Thanks,
>> Tim
>>
>|||Is it possible to create the subreport control on the fly and set the report
property then?
Tim
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:u5SBJiEpHHA.4192@.TK2MSFTNGP06.phx.gbl...
> Ahhh, that's what you want to do. No, you cannot change which subreport is
> called. What most people do in this situation is embed multiple subreports
> and then hide and show them depending on conditions. There is a visibility
> parameter that you can set to an expression to control this.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Tim Kelley" <tkelley@.company.com> wrote in message
> news:ujKjidEpHHA.3644@.TK2MSFTNGP02.phx.gbl...
>> Can I use this method to change the report (not the data) that is used in
>> a subreport?
>> Tim
>> "Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
>> news:ezNYoY8oHHA.4652@.TK2MSFTNGP02.phx.gbl...
>> There is in 2005. Expression based data sources (this is true for all
>> reports, not just sub reports).
>> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/rptsrvr9/html/4d8f0ae1-102b-4b3d-9155-fa584c962c9e.htm
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "Tim Kelley" <tkelley@.company.com> wrote in message
>> news:%23xZLyu6oHHA.2044@.TK2MSFTNGP04.phx.gbl...
>> Is there a way to change a subreports report source on the fly? I
>> would like to change the report based on a parameter that is passed to
>> the main report.
>> Thanks,
>> Tim
>>
>>
>|||You would need to create RDL on the flyl. RDL is the xml specification for
the report. You would need to change and deploy it and then remove it when
the user is done (all of this can only be done if you have your own website
integrated in). Non-trivial and slow (you have the time for deployment). If
you have your own website you could use the new webform control that comes
in VS 2005. It has a local mode where you give it the data and the report.
Again, it is non-trivial. When in local mode you have a whole lot more work
to do than you do in server mode.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Tim Kelley" <tkelley@.company.com> wrote in message
news:u5GQQ2EpHHA.2044@.TK2MSFTNGP04.phx.gbl...
> Is it possible to create the subreport control on the fly and set the
> report property then?
> Tim
> "Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
> news:u5SBJiEpHHA.4192@.TK2MSFTNGP06.phx.gbl...
>> Ahhh, that's what you want to do. No, you cannot change which subreport
>> is called. What most people do in this situation is embed multiple
>> subreports and then hide and show them depending on conditions. There is
>> a visibility parameter that you can set to an expression to control this.
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "Tim Kelley" <tkelley@.company.com> wrote in message
>> news:ujKjidEpHHA.3644@.TK2MSFTNGP02.phx.gbl...
>> Can I use this method to change the report (not the data) that is used
>> in a subreport?
>> Tim
>> "Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
>> news:ezNYoY8oHHA.4652@.TK2MSFTNGP02.phx.gbl...
>> There is in 2005. Expression based data sources (this is true for all
>> reports, not just sub reports).
>> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/rptsrvr9/html/4d8f0ae1-102b-4b3d-9155-fa584c962c9e.htm
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "Tim Kelley" <tkelley@.company.com> wrote in message
>> news:%23xZLyu6oHHA.2044@.TK2MSFTNGP04.phx.gbl...
>> Is there a way to change a subreports report source on the fly? I
>> would like to change the report based on a parameter that is passed to
>> the main report.
>> Thanks,
>> Tim
>>
>>
>>
>

Thursday, February 16, 2012

Causing a PostBack when user changes a parameter in Report Viewer

Does anyone know of a way to cause a postback when the user changes a parameter in the report viewer control? I need it to postback even if it is just text that was changed in a textbox. Basically I need it to do the same thing as when you click on a DateTime parameter to set a date.

I need this because I am allowing the user to save the settings as a preset to a XML file without having to first run the report. The GetParameters() method won't give me the new client selections without first running the report. But a postback will allow the GetParameters() method to give me the right parameters without running it.

Any ideas?

Nevermind...I have a workaround.

I just added a submit() to the "onclick" event to the Save Preset button. This updates the Report Viewer and then calls my C# function to get the parameter settings.