Can't See Function For Code Added In Report Properties

Sep 12, 2007

I put a function in the code section of Report Properties. I went to add an expression and can't find the function. I type =code. and did not see the function I created in the list.

Here's my code below:




Code Snippet
Public Function ConvertToStartDate(ByVal StartDate As String) As DateTime
Select Case StartDate
Case "Today"
Return DateTime.Today
Case "Yesterday"
Return DateTime.Today.AddDays(-1)
Case "30DaysOut"
Return DateTime.Today.AddDays(+30)
Case "2DaysPrior"
Return DateTime.Today.AddDays(-2)
' Additional cases
Case Else
Throw New ArgumentException("Unknown argument, " & StartDate, "StartDate")
End Select
End Function



I should be able to put in expression =code.ConvertToStartDate.StartDate("Today"), but that does not work. I get a red squiggly line under StartDate.

Thanks for your help,

Iris

View 3 Replies


ADVERTISEMENT

SQL 2012 :: Change Properties Of A Table Which Have Filestream When Column Added To It

Dec 6, 2014

I store files in db in sql server 2008 by filestream. But when a column would be added to table which have filestream, properties of table would be changed. by every things change on table, retrieve files will faced to error. but store process work probably.

and filestream filegroup at following address will be empty. why?

Right click on table --> properties --> storage --> filestream filegroup

View 0 Replies View Related

1 Inch Added To Bottom Margin Of Report

Dec 20, 2007

I'm having a relatively big issue with printing my check report. The report continues, time after time, and regardless of the margins I choose for the report, to be displaced an additional 1" up from the bottom of the page. The printing method is through our newly designed application which sends the emf rendering to the printer. We have gone through the liberty of modifying the actual print document in VB with margins set at 0,0,0,0 (L, R, T, B) and have paid close attention to the printer's maximum printing area. We have come to the conclusion that the problem is coming from reporting services. In addition to the extra margin space on the bottom of the page, there is also a slight yet noticeable shrinking of the page. Despite the fact that those are trade symptoms of another issue after the emf rendering we have modified every possible function of the printdocument and printer settings. So we continue to push the question, is this reporting services? We are fairly certain. I'm asssuming this is a bug in SSRS 2005, yet, I have yet to hear of any similiar case. This is our VS version info just incase:

Microsoft Visual Studio 2005
Version 8.0.50727.762 (SP.050727-7600)
Microsoft .NET Framework
Version 2.0.50727
Installed Edition: Enterprise
Microsoft Visual Basic 2005 77642-113-3000004-41917
Microsoft Visual Basic 2005
Microsoft Visual C# 2005 77642-113-3000004-41917
Microsoft Visual C# 2005
Microsoft Visual C++ 2005 77642-113-3000004-41917
Microsoft Visual C++ 2005
Microsoft Visual J# 2005 77642-113-3000004-41917
Microsoft Visual J# 2005
Microsoft Visual Studio Tools for Office 77642-113-3000004-41917
Microsoft Visual Studio Tools for the Microsoft Office System
Microsoft Visual Web Developer 2005 77642-113-3000004-41917
Microsoft Visual Web Developer 2005
Visual Studio 2005 Team Edition for Developers 77642-113-3000004-41917
Microsoft Visual Studio 2005 Team Edition for Software Developers
Crystal Reports AAC60-G0CSA4B-V7000AY
Crystal Reports for Visual Studio 2005

Microsoft Visual Studio 2005 Premier Partner Edition - ENU Service Pack 1 (KB926601)
This service pack is for Microsoft Visual Studio 2005 Premier Partner Edition - ENU.
If you later install a more recent service pack, this service pack will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/926601
SQL Server Analysis Services
Microsoft SQL Server Analysis Services Designer
Version 9.00.1399.00
SQL Server Integration Services
Microsoft SQL Server Integration Services Designer
Version 9.00.1399.00
SQL Server Reporting Services
Microsoft SQL Server Reporting Services Designers
Version 9.00.1399.00


I'm planning to talk to MS if nobody recognizes these symptoms. Any ideas would be greatly appreciated! Thanks!



UPDATE (12/20/2007 1:43:07 pm):
We have made a small break-through discovery. We found that that if we convert our report using a pdf rendering that the additional 1 inch added to the bottom margin is no longer there. So, pdf rendering would be an option if we became more desperate. However, this is too time consuming and we would much rather have the report directly sent to the print spooler instead of loading then spooling. Does anybody know what is going on with this apparent conflict between SSRS 2005 and our emf renderer?

View 6 Replies View Related

How To Detect When A New Report Is Added Into Reportng Services

Mar 17, 2008

Some power users who may or may not write good SQL for their reports have been given the ability to place their reports directly into production. I would like to receive an email notifiction (either triggered by the report being added or via sql job that runs daily) that let's me know when a new report has been added.

Does anyone know how to accomplish this?

Thanks,
Chris

View 1 Replies View Related

Table Function To Retrieve File Properties

Mar 25, 2008

Here's a table function that returns a table variable containing various file properties (creation date, size, etc.). The one limitation to remember is that it won't work with files on mapped drives; you have to use the full \<Server><Share><Folder1..Folder n><Filename> syntax. Still, it's a pretty useful thing to have around. :)

/****************************************************************************/
CREATE FUNCTION fnc_GetFileProps

(@FileName VARCHAR (1024))

RETURNS @Results TABLE (
ErrorCode TINYINT DEFAULT (0),
PropName VARCHAR (255),
PropValue SQL_VARIANT
)

AS
BEGIN
DECLARE @OLEResult INT
DECLARE @FS INT
DECLARE @FileID INT
DECLARE @Message VARCHAR (8000)
DECLARE @ErrorSource VARCHAR (255)
DECLARE @ErrorDesc VARCHAR (255)
DECLARE @INT INT
DECLARE @VARCHAR VARCHAR (1024)
DECLARE @DATETIME DATETIME
DECLARE @BIGINT BIGINT

-- Create an instance of the file system object
EXECUTE @OLEResult = sp_OACreate 'Scripting.FileSystemObject', @FS OUT
IF @OLEResult <> 0
BEGIN
EXEC sp_OAGetErrorInfo @FS, @ErrorSource OUT, @ErrorDesc OUT

INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, @ErrorSource, @ErrorDesc)

RETURN
END

EXEC @OLEResult = sp_OAMethod @FS, 'GetFile', @FileID OUT, @Filename
IF @OLEResult <> 0
BEGIN
EXEC sp_OAGetErrorInfo @FS, @ErrorSource OUT, @ErrorDesc OUT

INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, @ErrorSource, @ErrorDesc)

RETURN
END

EXEC @OLEResult = sp_OAGetProperty @FileID, 'Attributes', @INT OUT
IF @OLEResult <> 0
BEGIN
INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, 'Attributes', '<ERROR RETRIEVING PROPERTY>')
END
ELSE
INSERT @Results (PropName, PropValue)
VALUES ('Attributes', @INT)

EXEC @OLEResult = sp_OAGetProperty @FileID, 'DateCreated', @DATETIME OUT
IF @OLEResult <> 0
BEGIN
INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, 'DateCreated', '<ERROR RETRIEVING PROPERTY>')
END
ELSE
INSERT @Results (PropName, PropValue)
VALUES ('DateCreated', @DATETIME)

EXEC @OLEResult = sp_OAGetProperty @FileID, 'DateLastAccessed', @DATETIME OUT
IF @OLEResult <> 0
BEGIN
INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, 'DateLastAccessed', '<ERROR RETRIEVING PROPERTY>')
END
ELSE
INSERT @Results (PropName, PropValue)
VALUES ('DateLastAccessed', @DATETIME)

EXEC @OLEResult = sp_OAGetProperty @FileID, 'DateLastModified', @DATETIME OUT
IF @OLEResult <> 0
BEGIN
INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, 'DateLastModified', '<ERROR RETRIEVING PROPERTY>')
END
ELSE
INSERT @Results (PropName, PropValue)
VALUES ('DateLastModified', @DATETIME)

EXEC @OLEResult = sp_OAGetProperty @FileID, 'Name', @VARCHAR OUT
IF @OLEResult <> 0
BEGIN
INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, 'Name', '<ERROR RETRIEVING PROPERTY>')
END
ELSE
INSERT @Results (PropName, PropValue)
VALUES ('Name', @VARCHAR)

EXEC @OLEResult = sp_OAGetProperty @FileID, 'Path', @VARCHAR OUT
IF @OLEResult <> 0
BEGIN
INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, 'Path', '<ERROR RETRIEVING PROPERTY>')
END
ELSE
INSERT @Results (PropName, PropValue)
VALUES ('Path', @VARCHAR)

EXEC @OLEResult = sp_OAGetProperty @FileID, 'ShortPath', @VARCHAR OUT
IF @OLEResult <> 0
BEGIN
INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, 'ShortPath', '<ERROR RETRIEVING PROPERTY>')
END
ELSE
INSERT @Results (PropName, PropValue)
VALUES ('ShortPath', @VARCHAR)

EXEC @OLEResult = sp_OAGetProperty @FileID, 'Size', @BIGINT OUT
IF @OLEResult <> 0
BEGIN
INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, 'Size', '<ERROR RETRIEVING PROPERTY>')
END
ELSE
INSERT @Results (PropName, PropValue)
VALUES ('Size', @BIGINT)

EXEC @OLEResult = sp_OAGetProperty @FileID, 'Type', @VARCHAR OUT
IF @OLEResult <> 0
BEGIN
INSERT @Results (ErrorCode, PropName, PropValue)
VALUES (1, 'Type', '<ERROR RETRIEVING PROPERTY>')
END
ELSE
INSERT @Results (PropName, PropValue)
VALUES ('Type', @VARCHAR)

EXECUTE @OLEResult = sp_OADestroy @FileID
EXECUTE @OLEResult = sp_OADestroy @FS

RETURN
END
/****************************************************************************/


I geek, therefore I am

View 1 Replies View Related

Report Designer : No Fields Being Refreshed After Parameter Added...

Mar 27, 2008

I'm relatively new to Report Designer in VS 2005 and have been trying to get a parameterised report working.

I have an MDX query that works with the datasource I set up, but as soon as I try to add a parameter, the fields disappear from the dataset.

Here's the query:




Code Snippet
SELECT

NON EMPTY { [Measures].[Var Rc] }



ON COLUMNS,
NON EMPTY { ([Time].[Year - Quarter - Month - Date].[Date].ALLMEMBERS *



[Company Master].[Region].[Region].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME
ON ROWS
FROM

( SELECT ( Filter( [Company Master].[Region].[All].Children,



Instr( [Company Master].[Region].Currentmember.Properties( 'Member_Caption' ), @RegionParam ) > 0) )
ON COLUMNS FROM [Supplier Spend])
CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS



This is all a generated query apart from the filter. If I change the @RegionParam back to its old constant value (which was 'Europe') then the fields appear again. I've set up the Query Parameters to cope with @RegionParam and also put a Report Parameter in the Layout page that uses it.

I'm lost as to why the fields don't appear with the parameter in there...

Rob

View 2 Replies View Related

How To Show Description In Report Instead Of Code (Desc For Code Is In Master Table)

Mar 28, 2007

Dear Friends,



I am having 2 Tables.

Table 1: AddressBook
Fields --> User Name, Address, CountryCode



Table 2: Country
Fields --> Country Code, Country Name


Step 1 : I have created a Cube with these two tables using SSAS.



Step 2 : I have created a report in SSRS showing Address list.

The Column in the report are User Name, Address, Country Name



But I have no idea, how to convert this Country Code to Country name.

I am generating the report using the Layout tab. ( Data | Layout | Preview ) Report1.rdl [Design]



Anyone help me to solve this issue. Because, in our project most of the transaction tables have Code and Code description in master table. I need to convert all code into corresponding description in all my reports.




Thanks in advance.





Regards
Ramakrishnan
Singapore
28 March 2007

View 4 Replies View Related

Added Space Character On The Header/Footer Contents Of An Exported Report In Excel

May 21, 2008

A space was added as the first character of the contents in the Left, Center and Right section of the Report Header and Footer exported to Excel. Example :

In the RDL, Header values are:

Left = "Product Report" ; Center = "Confidential" ; Right = "Page n of n"

In the exported report to Excel, Header properties (-->File.-->Page Setup--> Header/Footer Tab) are:

Left = " Product Report" ; Center = " Confidential" ; Right = " Page n of n"

Is there a way to eliminate that space character?


Thanks in advance.

View 8 Replies View Related

Reporting Services :: Added Parameter In Report Builder Now Missing Query Results

Oct 30, 2015

So, this is my Query for dataset "SalesOrder":

SELECT
SO_Header.Customer
,SO_Header.Status
,SO_Header.Customer_PO
,Customer.Name
,SO_Header.Order_Taken_By

[Code] ...

I would like to have a parameter on my report to Select by Order_Taken_By. My attempt at that is here:

Dataset called OrderTaken:

select distinct SO_Header.Order_Taken_By
from SO_Header
Under the report Parameter Properties named @Order, under Available Values
Selected "Get Values from a query"

I have DataSet: OrderTaken

Value Field: Order_Taken_By
Label Field: Order_Taken_By

The values of the field Order_Taken_By is all text characters, no integer values.

Running the inital Query by itself yields results. When I add the parameter, I can make a selection, but now I get no results, even though there should be values for the choice I've chosen.

View 11 Replies View Related

Report Properties Window

Jan 18, 2007

"InteractiveHeight is only supported on RS 2005. Opening a report in BI Development Studio of SQL Server 2005 will automatically add this property. You can find the property on the Report element. In report designer (properties window) it is also on the report element / Layout / Interactive Size / Height."


Why don't I see the Report Properties screen that includes the Interactive Size elements? My Report Properties screen looks the same as it did in VS2003.

I need to modify the InteractiveHeight element. It has been added to the RDL source.

Here's what's installed:

Microsoft Visual Studio 2005
Version 8.0.50727.762 (SP.050727-7600)
Microsoft .NET Framework
Version 2.0.50727

Installed Edition: Professional

Microsoft Visual Basic 2005 77626-009-0000007-41496
Microsoft Visual Basic 2005

Microsoft Visual Web Developer 2005 77626-009-0000007-41496
Microsoft Visual Web Developer 2005

Microsoft Web Application Projects 2005 77626-009-0000007-41496
Microsoft Web Application Projects 2005
Version 8.0.50727.762

Microsoft Visual Studio 2005 Professional Edition - ENU Service Pack 1 (KB926601)
This service pack is for Microsoft Visual Studio 2005 Professional Edition - ENU.
If you later install a more recent service pack, this service pack will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/926601

SQL Server Analysis Services
Microsoft SQL Server Analysis Services Designer
Version 9.00.2047.00

SQL Server Integration Services
Microsoft SQL Server Integration Services Designer
Version 9.00.2047.00

SQL Server Reporting Services
Microsoft SQL Server Reporting Services Designers
Version 9.00.2047.00

View 1 Replies View Related

Report Properties - Author

Apr 25, 2007

Hi All,



I cannot find any way to retrieve the "author" of the report via code in asp .net. The author is in the "report properties" window.



Could somebody please help me with this ?



Thanks

View 8 Replies View Related

Report Textbox Properties / Formats

Feb 28, 2006

Greetings -

Am having problems setting a normal SSN xxx-xx-xxx format for a report textbox using the Textbox Properties / Format tab. The data is stored as text, and am using the "Format Code .... " option. When I choose "Custom" option, and attempt any formatting string containing the "-", the SSN is displayed without the "-". Nothing I have tried works.

What is the correct context string for this format?

Tks.

View 2 Replies View Related

Setting Up Default Report Startup Properties

Apr 13, 2007

Hello,

Is it possible to establish a set of default report and report body properties, perhaps in an ini file of some sort so that upon creating a new project and adding a new report item the developer does not have to go through the process of setting up all the interactive sizes, margins, paper sizes, etc each and every time? We have an established header that we incorporate on all reports and while in transition to the new Reporting Services it was my hope of finding something will create the first set of default conditions to help us automate the process just a bit.



Thank you.

View 2 Replies View Related

Question On Particular Report Region Layout Properties

May 3, 2007

Hi, all experts here,

Thanks a lot for your kind attention.

I have been trying to adjust the report regions fit into the whole report page. I could see the width and height property of the whole report page from the report property dialogue, but where can I find the width and height for the particular report region like the table? Then I could accordingly adjust the layout of both the report page and report region like table?

Hope my question is clear for your help.

With best regards,

Yours sincerely,

View 5 Replies View Related

Reporting Services :: Referencing SSRS Variables Set In Report Properties

Jun 20, 2013

I am modifying a report that sets this variable at the beginning of every dataset:

declare @current_minute int
set @current_minute = DATEPART(N, GETDATE()) % 3

My idea is to set this variable in the Report Properties instead. When I do set this variable it in a Text Box or a Dataset, I get errors such as:

The expression used for the calculated field '=Variables!report_var.Value' includes a variable reference. Variable values cannot be used in calculated field expressions.

The Variable(report_var) expression for the report ‘body’ contains an error: [BC30451] Name 'N' is not declared.

What other strategies can I use to set a variable globally, instead of at the beginning of each dataset?

View 3 Replies View Related

Expression To Get CreatedBy, CreationDate, ModifiedBy, And ModifiedDate Properties For Report?

Jun 6, 2007

If you look at the General Properties for a report in Report Manager, there are 4 properties listed at the top:







Modified Date:

2/26/2007 6:37 PM


Modified By:

DOMAINusername1


Creation Date:

2/14/2006 5:19 PM


Created By:

DOMAINusername2



What I'm looking for is if there's a way to retrieve these properties via an expression from a textbox within a report. For instance, there's already an expression that is:



=Globals!ReportName



I know it won't be that easy for the CreatedBy, CreationDate, ModifiedBy, and ModifiedDate properties, but I thought I'd ask if there was a workaround or hack.



We're wanting to put that info into the footer of all our reports. (Actually this is for Report Builder reports, but you can still use expressions in Report Builder reports, so it should apply as it would to normal reports.)

View 1 Replies View Related

SQL 2012 :: Connection Properties Versus SSMS Server Properties

Mar 16, 2015

I have an ODBC connection string that is working fine with the following properties:

Database="XXXXXXX",Network="YYYYYY"; strangely no server is specified in the string, but it is specified in the ODBC Connection file.

I am trying to do a new server registration in SSMS for this database.However, I don't understand where the network spec is placed.

Under Registered server name I've tried:

YYYYYYXXXXX

When I browse the server for the database instance list, I receive "network path was not found".

I even tried:"XXXXXXX",Network="YYYYYY" for the registered server name.Same error message.

What am I doing wrong ?

View 1 Replies View Related

Converting Some VBA Code To SQL Function

Sep 6, 2006

Hi,
I'm new to this SQL thing, and I need some help with s stored procedure/function.
First, the scenario:
We are a social service agency, and like all such organizations, we have requirements for perodic reports about our clients. There are lots of them, but if I figure how to do one, I think I can apply the theory to the others.

First, this is some sample VBA code I've tested and which proved satisfactory for the basic task, just for a form. It is passed a date (dteDOP), then adds 3 months, (quarterly report)and loops until it exceeds the current date, thus generating the a due date for the the next report.

'initialize the due date
dteDueDate = dteDOP

'Add quarterly intervals, starting with (DOP + 3 months), until
'you exceed today's date
Do Until dteDueDate > Date
dteDueDate = DateAdd("m", 3, dteDueDate)
Loop
'set a text box to the next due date after today
Me.txtNextQuarDue = dteDueDate

Obviously, this isn't really a function at the moment, but it worked as a test of the logic, with instantly visible results.

This works, but I'd like to do it on the server end, so I can send out notifications. How would this be accomplished as an SQL stored procedure/function? Obviously, for that I'll need to again do a comparison of the current date with the due date for timing concerns, but that should be relatively simple. Also, I know that the '@' symbol is somehow part of variables in SQL Procedures/functions, could you give me a very basic explanation of this, especially the difference between @xxx and @@xxx?

Thanks in advance,
Stephen

-----------------------------------------------
-----------------------------------------------
Gary Getsum: What happened to my mule?
DM: It's dead; It got stung by a giant wasp.
Gary: Can't I heal it?
DM: I'm sorry, I know you were fond of the mule, but it just got attacked by a wasp the size of a Volkswagen!
Gary: So?
DM: Dude, look- you're going to have to carry all your own treasure now... Your mule gives new meaning to the term "Puff Daddy".

View 17 Replies View Related

Errors In Function Code

Feb 2, 2007

Hi,

I'm pretty new to SQL and I'm having trouble with a function, probably just syntax. I'm trying to consolidate several rows of data into a single row text field.
The calling program can use views but not functions so I need to get a table into a view with the consolidated lines.

Also, I would think this could be consolidated to a single view that calls one function. Is that possible, how would I do it?

Thanks for any help,
Steve


VIEW WHERE DATA COMES FROM:
CUST_ORDER_ID | LINE_TEXT
number1 | first line item text
number1 | Second line item text
number1 | Third line item text
number2 | first line item text
number2 | Second line item text
...


VIEW I WANT:
CUST_ORDER_ID | CO_LINES_TEXT
number1 | Second line item text 'crlf' Third Line item text
number2 | Second line item text


FUNCTION CODE: This is the function code with errors

CREATE FUNCTION dbo.tvf_NC_CO_LINES_TEXT (@ORDER_ID VARCHAR(20))

RETURNS @NC_CO_LINES TABLE
(
CUST_ORDER_ID VARCHAR(20) PRIMARY KEY NOT NULL,
CO_LINES_TEXT VARCHAR(1000) NULL
)
AS
BEGIN
DECLARE @COLinesString VARCHAR(1000);
SET @ORDER_ID = CUST_ORDER_ID;
SELECT @COLinesString = COALESCE(@COLinesString + Char(13) + Char(10), '') + LINE_STRING
FROM NC_CO_LINES_STRING
WHERE NC_CO_LINES_STRING.CUST_ORDER_ID = @ORDER_ID
SET @COLinesString = CO_LINES_TEXT
RETURN
END;

GO


ERROR MESSAGES:
Msg 207, Level 16, State 1, Procedure tvf_NC_CO_LINES_TEXT, Line 16
Invalid column name 'CUST_ORDER_ID'.
Msg 207, Level 16, State 1, Procedure tvf_NC_CO_LINES_TEXT, Line 20
Invalid column name 'CO_LINES_TEXT'.


VIEW CODE:
SELECT dbo.CUST_ORDER_LINE.CUST_ORDER_ID, CAST(CAST(dbo.CUST_ORDER_LINE.ORDER_QTY AS INT) AS VARCHAR(2))
+ ' ' + dbo.CUST_ORDER_LINE.PART_ID + ' ' + dbo.PART.DESCRIPTION AS LINE_STRING
FROM dbo.CUST_ORDER_LINE INNER JOIN
dbo.PART ON dbo.CUST_ORDER_LINE.PART_ID = dbo.PART.ID
WHERE (dbo.CUST_ORDER_LINE.LINE_NO > 1)

Steve Bermes
Novae Corp.

View 2 Replies View Related

Reporting Services :: Go To Report Function Works In Report Builder But Not In Web?

Jul 6, 2015

I've gotten to the point of publishing the new reports on the SSRS server and have run into the following problem.

I use a field in the primary report with the "Go to report" action to open up another report (also published) for more details. It works properly from within ReportBuilder (2.0) using the report server and I can go to and from the secondary report as I expect. Its passing the correct parameters to the second report and its runs.

But when I use the reports from the SSRS web, the Go To link no longer works. Mouse hover shows its still a link but clicking goes no where. I can run both reports independently from SSRS and they still work.  

I've tried this in IE and Chrome with no luck in either. I also poked around at Compatability view and popup blocker but nothing made any difference.

View 2 Replies View Related

Custom Code Error With VB Function

Apr 26, 2007

Hello, I am about out of hair from pulling it out. If someone could please show me what I'm doing wrong I would really appreciate it. I have this function for a SSRS 2005 report:



Public Function funAdditions(pFields As Fields) As Double
if pFields !FA00902_AMOUNT.Value > 0 and
pFields !FA00902_TRANSACCTTYPE.Value = 3 and
pFields !FA00902_DEPRTODATE.Value > Parameters!BeginDate.Value and
pFields !FA00902_DEPRTODATE.Value <= Parameters!CutOffDate.Value and NOT
instr(pFields !FA00902_SOURCDOC.Value, "FACHG")=1
then return pFields !FA00902_AMOUNT.Value
end
else if pFields !FA00902_TRANSACCTTYPE.Value = 3 and
pFields !FA00902_DEPRTODATE.Value > Parameters!BeginDate.Value and
pFields !FA00902_DEPRTODATE.Value <= Parameters!CutOffDate.Value and
instr(pFields !FA00902_SOURCDOC.Value, "FACHG")=1
then return pFields !FA00902_AMOUNT.Value
end
End Function



...and after much research cannot figure out the solution to this error:

[rsCompilerErrorInCode] There is an error on line 1 of custom code: [BC30201] Expression expected.



I'm new to SSRS so is there a syntax error I'm missing?



Thanks in advance,

Buster

View 1 Replies View Related

Code A Function To Return A Dataset In Which There Are Two Tables And Relationship

Aug 9, 2006

I used a function to create dataset as below:
 Public Function GetSQLDataSet(ByVal SQL As String) As DataSet
......
      MyConnection = New SqlConnection(MyConnectionString)
      MyCommand = New SqlCommand(SQL, MyConnection)
      MyDataSet = New DataSet
      MySQLDataAdapter = New SqlDataAdapter(MyCommand)
     MySQLDataAdapter.Fill(MyDataSet)
......
End function
It works fine.
How to code a function to return a dataset in which there are two tables and relationship?
 

View 1 Replies View Related

Code That Return Correct Number Of Record When Run Without Aggregate Function

Nov 26, 2013

I have sql code that returns the correct number of record when run without an aggregate function like count(myfield) and group by myfield. It always returns 86 row which is correct when Select DISTINCT is used. As, expected when DISTINCT is not used I get double the number if rows or 172. But when I count(myfield) and group by myfield the count is 172 and not 86. The strangest thing about this is that when I am grouping a set of items

Group 1

Group 2

Group 3

The other group sum up correctly while others don't. What can explain this? Here is the code.

Select DISTINCT ws.p4Districtnumber, ws.cycle, ws.worksetid, count(msi.MeterSessionInputKey) as ASND
from fcs.dbo.WorkSet as ws
left outer join fcs.dbo.WorkAssignment as wa
on ws.WorkSetID = wa.WorkSetID
left outer join fcs.dbo.MeterSessionInput as msi
on wa.worksetkey = msi.worksetkey

[code]....

View 3 Replies View Related

Custom Code/function To Format Seconds To Hh:mm:ss With Ability To Go Over 24 Hours

Aug 4, 2007



Hello,

I am trying to get this to work - but it only returns minutes & seconds:

Function Seconds2mmss(ByVal seconds As Integer) As String
Dim ss As Integer = seconds Mod 60
Dim mm As Integer = (seconds - ss) / 60
Seconds2mmss = String.Format("{0:0}:{1:00}", mm, ss)
End Function

Can anyone help me out? I am not that familiar with VB.

Thanks,
Deb

View 2 Replies View Related

Make Sql Function To Modify Data Like Sql Procedure To Improve Code Structure And Readability.

Aug 27, 2007

Now Sql Function can not modify data as Sql Procedure like other database, it's very troublesome at most case!
in most case, Sql Function is used to improve code structure then it can be maintanced easy! BUT only because it can not modify data, there are 2 troublesome way:

1. Make all callers in the path from Sql Functions to Sql Procedure. and the coder will cry, the code will become very
confusional , and very difficult to maintance.

2. Divide the Sql Function into a thin CLR wrapper to call a Sql Procedure, can only use another connection, BUT can not be in the same transaction context And the code is ugly and slow.

You should not give limitation to Sql Function, should just limit the using context of Sql Function!

The sql code is more difficult to read and maintance than norm code(C#), then the improving code structure and readability should be one of your most important task, that's why microsoft!


View 6 Replies View Related

Transact SQL :: Ensure Code Non Regression By Keeping Consistent Signature For Procedure / Views And Function

Jul 28, 2015

In the 70-461 objectives it says: Ensure code non regression by keeping consistent signature for procedure, views and function (interfaces); security implications...I think I understand what this means in general. They want us to be able to create a view that will still be able to call the original data even if the table is modified.  In other words, the view table shouldn't easily be broken. ie, type a code that does NOT ensure non regression, then change the code so that it does ensure non regression. 

View 4 Replies View Related

Transact SQL :: Encrypt Java Code Using With Encryption Clause From Server Stored Procedure Or Function

Nov 3, 2015

How to encrypt the java application code using the 'with encryption' clause from sql server stored procedure or function.

View 3 Replies View Related

Sql Code Of Report

Oct 22, 2007

I want see the sql code of himself the made report in CRM. Is that possible ?

View 4 Replies View Related

Report Parameters Using Code

Feb 21, 2008

Hello Everyone,

I would like to create a report parameter that will allow the user to select a week from a list of all weeks so far this year.

For example:

First Parameter is Week: (Week 1, Week 2, ... , Week 7)
Second Parameter is Year: 2008

How can I accomplish this? Can I create a function and use it as a parameter query?

Thank You in advanced

View 5 Replies View Related

HTLM Code In My Report

Mar 30, 2007

I'm having problems with HTML code showing up in my reports. I have a website with a sql database on the back end. When users make comments I get html code in my comments field on the database that then shows up when I run my reports that include the comments. Examples;

<Strong> test comment <Strong>

Comment <br><br> test comment

View 2 Replies View Related

Print Report From C# Code

Feb 8, 2007

hi all.

how can i send a report, (stored on the reporting server) to print?

i know i can render it, but i want to print it , is it possible?

View 1 Replies View Related

Create A Dataset With .Net Code And Render Report From It. Possible?

Sep 20, 2007



Hi
I wonder if it is possible to create a dataset in code and then feed it to a Reporting Svcs (RS) report and have it rendered on the data from this dataset.
My collegues does this with Crystal and it would break my heart if I cant do this with (RS)...
I have tried to find a solution but so far, no luck.
Anyone have any ideas?

/F

View 3 Replies View Related

How To Reach Report Variables From Custom Code

Jun 19, 2007

Hello,

I'd like to use Globals!ReportName and User!Language in custom code like this:

Function Localize(ByVal key As String) As String
Return ReportUtil.Localizer.Localize(Globals!ReportName, key, User!Language)
End Function

If I preview the report I get an error message saying that there is error on line 2 of custom code.
Is it possible to reach report variables in custom code?

Thanks!

Werner

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved