+ Reply to Thread
Results 1 to 3 of 3

Thread: SSRS Expressions

  1. #1
    Barn Newbie Wannabe is an unknown quantity at this point Wannabe's Avatar
    Join Date
    Sep 2009
    Posts
    1
    Rep Power
    3

    SSRS Expressions

    I have an expression that is not working and not sure why. Can someone help? I am using SSRS 2005

    MonthName(Int(Fields!MonthCompleted.Value)) & " Totals:"

    The error is: [rsRuntimeErrorInExpression] The Value expression for the textbox ‘textbox4’ contains an error: Value cannot be null.
    Parameter name: Argument 'Number' is Nothing

    Trouble is...none of the data is null or empty...I checked. The field "MonthCompleted" so far comes back as 1, 2, 8, and 9 (four different records). The 8 successfully converts to August, but the other rows report the error.

    Thank you for any help.

    Here is my full report code:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
      <DataSources>
        <DataSource Name="MyDatabase">
          <rd:DataSourceID>Removed</rd:DataSourceID>
          <DataSourceReference>MyDatabase</DataSourceReference>
        </DataSource>
      </DataSources>
      <InteractiveHeight>11in</InteractiveHeight>
      <rd:DrawGrid>true</rd:DrawGrid>
      <InteractiveWidth>8.5in</InteractiveWidth>
      <rd:SnapToGrid>false</rd:SnapToGrid>
      <RightMargin>0.75in</RightMargin>
      <LeftMargin>0.75in</LeftMargin>
      <BottomMargin>1in</BottomMargin>
      <rd:ReportID>170be701-eedc-4904-a82f-f0b6h5o91y99</rd:ReportID>
      <DataSets>
        <DataSet Name="MyDatasetName">
          <Fields>
            <Field Name="TicketId">
              <DataField>TicketId</DataField>
              <rd:TypeName>System.Int32</rd:TypeName>
            </Field>
            <Field Name="PriorityId">
              <DataField>PriorityId</DataField>
              <rd:TypeName>System.Int32</rd:TypeName>
            </Field>
            <Field Name="Priority">
              <DataField>Priority</DataField>
              <rd:TypeName>System.String</rd:TypeName>
            </Field>
            <Field Name="TicketCategoryId">
              <DataField>TicketCategoryId</DataField>
              <rd:TypeName>System.Int32</rd:TypeName>
            </Field>
            <Field Name="TicketCategory">
              <DataField>TicketCategory</DataField>
              <rd:TypeName>System.String</rd:TypeName>
            </Field>
            <Field Name="SubCategoryId">
              <DataField>SubCategoryId</DataField>
              <rd:TypeName>System.Int32</rd:TypeName>
            </Field>
            <Field Name="SubCategory">
              <DataField>SubCategory</DataField>
              <rd:TypeName>System.String</rd:TypeName>
            </Field>
            <Field Name="SubCategoryIdentifierId">
              <DataField>SubCategoryIdentifierId</DataField>
              <rd:TypeName>System.Int32</rd:TypeName>
            </Field>
            <Field Name="NetworkId">
              <DataField>NetworkId</DataField>
              <rd:TypeName>System.Int32</rd:TypeName>
            </Field>
            <Field Name="TicketNumber">
              <DataField>TicketNumber</DataField>
              <rd:TypeName>System.String</rd:TypeName>
            </Field>
            <Field Name="PocOrganizationId">
              <DataField>PocOrganizationId</DataField>
              <rd:TypeName>System.Int32</rd:TypeName>
            </Field>
            <Field Name="BuildingId">
              <DataField>BuildingId</DataField>
              <rd:TypeName>System.Int32</rd:TypeName>
            </Field>
            <Field Name="PocEmail">
              <DataField>PocEmail</DataField>
              <rd:TypeName>System.String</rd:TypeName>
            </Field>
            <Field Name="Room">
              <DataField>Room</DataField>
              <rd:TypeName>System.String</rd:TypeName>
            </Field>
            <Field Name="Problem">
              <DataField>Problem</DataField>
              <rd:TypeName>System.String</rd:TypeName>
            </Field>
            <Field Name="MonthCompleted">
              <DataField>MonthCompleted</DataField>
              <rd:TypeName>System.Int32</rd:TypeName>
            </Field>
            <Field Name="DateCompleted">
              <DataField>DateCompleted</DataField>
              <rd:TypeName>System.DateTime</rd:TypeName>
            </Field>
            <Field Name="TimeLost">
              <DataField>TimeLost</DataField>
              <rd:TypeName>System.Int32</rd:TypeName>
            </Field>
          </Fields>
          <Query>
            <DataSourceName>MyDatasource</DataSourceName>
            <CommandType>StoredProcedure</CommandType>
            <CommandText>ListOpenTickets</CommandText>
            <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
          </Query>
        </DataSet>
      </DataSets>
      <Code />
      <Width>5.17708in</Width>
      <Body>
        <ReportItems>
          <Textbox Name="textbox1">
            <rd:DefaultName>textbox1</rd:DefaultName>
            <Width>5in</Width>
            <Style>
              <Color>SteelBlue</Color>
              <FontFamily>Tahoma</FontFamily>
              <FontSize>20pt</FontSize>
              <FontWeight>700</FontWeight>
              <PaddingLeft>2pt</PaddingLeft>
              <PaddingRight>2pt</PaddingRight>
              <PaddingTop>2pt</PaddingTop>
              <PaddingBottom>2pt</PaddingBottom>
            </Style>
            <ZIndex>1</ZIndex>
            <CanGrow>true</CanGrow>
            <Height>0.5in</Height>
            <Value>New Open Tickets By Month</Value>
          </Textbox>
          <Matrix Name="matrix1">
            <MatrixColumns>
              <MatrixColumn>
                <Width>0.9375in</Width>
              </MatrixColumn>
            </MatrixColumns>
            <DataSetName>MyDataSetName</DataSetName>
            <RowGroupings>
              <RowGrouping>
                <Width>0.03125in</Width>
                <DynamicRows>
                  <Grouping Name="matrix1_Month">
                    <GroupExpressions>
                      <GroupExpression>=Fields!MonthCompleted.Value</GroupExpression>
                    </GroupExpressions>
                  </Grouping>
                  <Sorting>
                    <SortBy>
                      <SortExpression>=Fields!MonthCompleted.Value</SortExpression>
                      <Direction>Ascending</Direction>
                    </SortBy>
                  </Sorting>
                  <ReportItems>
                    <Textbox Name="textbox5">
                      <rd:DefaultName>textbox5</rd:DefaultName>
                      <Style>
                        <Color>White</Color>
                        <BorderColor>
                          <Default>White</Default>
                        </BorderColor>
                        <FontFamily>Tahoma</FontFamily>
                        <FontWeight>700</FontWeight>
                        <TextAlign>Right</TextAlign>
                        <PaddingRight>2pt</PaddingRight>
                      </Style>
                      <ZIndex>3</ZIndex>
                      <CanGrow>true</CanGrow>
                      <Value>=Fields!MonthCompleted.Value</Value>
                    </Textbox>
                  </ReportItems>
                </DynamicRows>
              </RowGrouping>
              <RowGrouping>
                <Width>4.01042in</Width>
                <DynamicRows>
                  <Grouping Name="matrix1_TicketCategory">
                    <GroupExpressions>
                      <GroupExpression>=Fields!MonthCompleted.Value</GroupExpression>
                      <GroupExpression>=Fields!TicketCategory.Value</GroupExpression>
                    </GroupExpressions>
                  </Grouping>
                  <Sorting>
                    <SortBy>
                      <SortExpression>=Fields!TicketCategory.Value</SortExpression>
                      <Direction>Ascending</Direction>
                    </SortBy>
                  </Sorting>
                  <Subtotal>
                    <ReportItems>
                      <Textbox Name="textbox4">
                        <rd:DefaultName>textbox4</rd:DefaultName>
                        <Style>
                          <BackgroundColor>#6e9eca</BackgroundColor>
                          <BorderColor>
                            <Default>LightGrey</Default>
                          </BorderColor>
                          <BorderStyle>
                            <Default>Solid</Default>
                          </BorderStyle>
                          <FontFamily>Tahoma</FontFamily>
                          <FontWeight>700</FontWeight>
                          <TextAlign>Right</TextAlign>
                          <PaddingLeft>2pt</PaddingLeft>
                          <PaddingRight>2pt</PaddingRight>
                          <PaddingTop>2pt</PaddingTop>
                          <PaddingBottom>2pt</PaddingBottom>
                        </Style>
                        <CanGrow>true</CanGrow>
                        <Value>=MonthName(Int(Fields!MonthCompleted.Value)) &amp; " Totals:"</Value>
                      </Textbox>
                    </ReportItems>
                    <Style>
                      <BorderColor>
                        <Top>Black</Top>
                      </BorderColor>
                      <BorderStyle>
                        <Top>Solid</Top>
                      </BorderStyle>
                      <BorderWidth>
                        <Top>2pt</Top>
                      </BorderWidth>
                    </Style>
                  </Subtotal>
                  <ReportItems>
                    <Textbox Name="TicketCategory">
                      <rd:DefaultName>TicketCategory</rd:DefaultName>
                      <Style>
                        <BorderColor>
                          <Default>LightGrey</Default>
                        </BorderColor>
                        <BorderStyle>
                          <Default>Solid</Default>
                        </BorderStyle>
                        <FontFamily>Tahoma</FontFamily>
                        <TextAlign>Left</TextAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                      </Style>
                      <ZIndex>2</ZIndex>
                      <CanGrow>true</CanGrow>
                      <Value>=Fields!TicketCategory.Value</Value>
                    </Textbox>
                  </ReportItems>
                </DynamicRows>
              </RowGrouping>
            </RowGroupings>
            <Top>0.75in</Top>
            <ColumnGroupings>
              <ColumnGrouping>
                <Height>0.27083in</Height>
                <DynamicColumns>
                  <Grouping Name="matrix1_Priority">
                    <GroupExpressions>
                      <GroupExpression>=Fields!Priority.Value</GroupExpression>
                    </GroupExpressions>
                  </Grouping>
                  <ReportItems>
                    <Textbox Name="Priority">
                      <rd:DefaultName>Priority</rd:DefaultName>
                      <Style>
                        <Color>White</Color>
                        <BackgroundColor>#6e9eca</BackgroundColor>
                        <BorderColor>
                          <Default>LightGrey</Default>
                        </BorderColor>
                        <BorderStyle>
                          <Default>Solid</Default>
                        </BorderStyle>
                        <FontFamily>Tahoma</FontFamily>
                        <FontWeight>700</FontWeight>
                        <TextAlign>Right</TextAlign>
                        <PaddingLeft>4pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                      </Style>
                      <ZIndex>4</ZIndex>
                      <CanGrow>true</CanGrow>
                      <Value>=Fields!Priority.Value</Value>
                    </Textbox>
                  </ReportItems>
                </DynamicColumns>
              </ColumnGrouping>
            </ColumnGroupings>
            <Width>4.97917in</Width>
            <Corner>
              <ReportItems>
                <Textbox Name="textbox6">
                  <Style>
                    <FontFamily>Tahoma</FontFamily>
                    <FontSize>12pt</FontSize>
                    <FontWeight>700</FontWeight>
                    <TextAlign>Left</TextAlign>
                    <PaddingLeft>2pt</PaddingLeft>
                    <PaddingRight>2pt</PaddingRight>
                    <PaddingTop>2pt</PaddingTop>
                    <PaddingBottom>2pt</PaddingBottom>
                  </Style>
                  <ZIndex>5</ZIndex>
                  <CanGrow>true</CanGrow>
                  <Value />
                </Textbox>
              </ReportItems>
            </Corner>
            <MatrixRows>
              <MatrixRow>
                <Height>0.21in</Height>
                <MatrixCells>
                  <MatrixCell>
                    <ReportItems>
                      <Textbox Name="textbox2">
                        <rd:DefaultName>textbox2</rd:DefaultName>
                        <Style>
                          <BorderColor>
                            <Default>LightGrey</Default>
                          </BorderColor>
                          <BorderStyle>
                            <Default>Solid</Default>
                          </BorderStyle>
                          <FontFamily>Tahoma</FontFamily>
                          <PaddingLeft>2pt</PaddingLeft>
                          <PaddingRight>2pt</PaddingRight>
                          <PaddingTop>2pt</PaddingTop>
                          <PaddingBottom>2pt</PaddingBottom>
                        </Style>
                        <ZIndex>1</ZIndex>
                        <CanGrow>true</CanGrow>
                        <Value>=Count(Fields!TicketId.Value)</Value>
                      </Textbox>
                    </ReportItems>
                  </MatrixCell>
                </MatrixCells>
              </MatrixRow>
            </MatrixRows>
            <Height>0.69083in</Height>
          </Matrix>
        </ReportItems>
        <Height>1.48584in</Height>
      </Body>
      <Language>en-US</Language>
      <TopMargin>1in</TopMargin>
    </Report>
    

  2. #2
    I like Data Cubes too... Lauramc has a spectacular aura about Lauramc has a spectacular aura about Lauramc's Avatar
    Join Date
    Mar 2008
    Location
    Far Far Away
    Posts
    387
    Real Name
    Laura
    Rep Power
    5

    I tried the expression and it seems to work. I couldn't say why you are getting the null message. The only other guess I have is that perhaps your completed value CAN be null. You might try adding a check to see if it is null. If you can do this in the SQL so much the better. You also might want to ensure that you are never passing a value beyond 1 through 12.
    "The Enrichment Center is required to remind you that first you will be baked, then there will be cake." - GLaDOS

  3. #3
    Wolfmaster Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy's Avatar
    Join Date
    Mar 2008
    Location
    Peoria, IL
    Posts
    2,386
    Blog Entries
    5
    Real Name
    Wolff
    Rep Power
    15

    Indeed, the only way I can reproduce this problem is for the value of MonthCompleted to be NULL. A value of 13 causes a different error message.
    Wolffy
    .-- ----- ..-. ..-. -.--
    Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Void where prohibited by law. Not valid in California. Your mileage may vary.

+ Reply to Thread

Similar Threads

  1. Counting a field of two columns if the values don't match in SSRS
    By kristilee in forum SQL Server Reporting Services Help
    Replies: 5
    Last Post: September 4th, 2009, 12:21 PM
  2. Backup SSRS Server
    By harish in forum SQL Server Reporting Services Help
    Replies: 4
    Last Post: May 6th, 2009, 06:58 AM
  3. Writing Expressions
    By nboscaino in forum Microsoft Access
    Replies: 3
    Last Post: August 21st, 2008, 05:48 PM
  4. Regular Expressions in C#...
    By Lauramc in forum .NET Development
    Replies: 2
    Last Post: April 21st, 2008, 12:54 PM
  5. Common Regular Expressions
    By jmurrayhead in forum .NET Development
    Replies: 0
    Last Post: April 21st, 2008, 12:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO