Showing posts with label ReportNet. Show all posts
Showing posts with label ReportNet. Show all posts

Mar 14, 2008

ReportNet : Relationship between ReportView and source

This SQL returns the relationship between ReportView and their source.
Run on content store database.
This is for SQLServer.

SELECT
  N.Name AS ReportViewName
 ,P.BASE AS ReportSource
FROM
 CMOBJECTS O
  INNER JOIN CMOBJPROPS6 P
   ON
    O.CMID = P.CMID 
  INNER JOIN CMOBJNAMES N
    ON
    O.CMID = N.CMID 
WHERE
     O.CLASSID = 19
 AND N.LOCALEID = 122 

Mar 11, 2008

ReportNet : Stored Procedure as a data source #1

This is the example of how to use stored procedure as a data source. This sample stored procedure has one parameter and returns the result of select statement.
This is the sample for SQLServer.

Run this SQL on the database

CREATE TABLE [dbo].[USER](
[USER_NO] [tinyint] NULL,
[USER_NAME] [varchar](20) COLLATE Japanese_CI_AS NULL
) ON [PRIMARY]
GO

INSERT INTO [dbo].[USER]
([USER_NO] ,[USER_NAME])
VALUES
(1,'MAHESH')

INSERT INTO [dbo].[USER]
([USER_NO] ,[USER_NAME])
VALUES
(2,'DAVID')

INSERT INTO [dbo].[USER]
([USER_NO] ,[USER_NAME])
VALUES
(3,'KOICHI')

INSERT INTO [dbo].[USER]
([USER_NO] ,[USER_NAME])
VALUES
(4,'BRAD')
GO

CREATE PROCEDURE SP_SELECT_USER
(@USER_NO TINYINT)
AS

SELECT [USER_NO]
,[USER_NAME]
FROM [dbo].[USER]
WHERE
[USER_NO] = @USER_NO
GO

Import stored procedure as a Metadata on Framework Manager

Edit definition of stored procedure

If ths stored procedure has a parameter, you have to set the value in this form.

Click Test before setting the value and Set 1 in value on Prompt Values form

Select the parameter and click Edit

Set the value on Edit Value form

?PROMPT_NAME?
You can use user prompt here with this expression. When user runs a report which uses this data source, this prompt is shown. The stored procedure is imported as a data source. Then it is be able to used in Report Studio/Query Studio.

Mar 10, 2008

ReportNet : Prompt Customize - Default Value

You can use default value in a dropdown list with Java script. It is also possible to change first word in that.

  • Set ID on the property of the dropdown list
  • Add two 'HTML Item'd after the dropdown list
  • Edit first HTML Item as follows
<script type="text/javascript">
function go(){
 var combo1 = document.getElementsByName("_oLstChoicesC0")[0];
 combo1(0).text="All Customer";
 combo1(1).text="------------------------------";
 combo1.selectedIndex="0";
}
</script>
_oLstChoices means a dropdown list. C0 is ID which is set in the property. Change the number combo1.selectedIndex="0" to the default index. You can change the first word if you change the strings in combo1(0).text.
  • Edit second HTML Item as follows
<img src="http://www.blogger.com/pat/images/blank.gif" onload="go()" />
This is to execute Java script on that report. Then this is the result.