Telerik Forums
Reporting Forum
9 answers
440 views
Does anyone know how to bind a report to a webservice and have it call that service each time the parameters change or the report is refreshed?  I have not seen any answers to this.  I have tried to override the OnNeedDataSource in a base class, handling the NeedDataSource event and according to all the other post this only gets called when the datasource is null which is only once.  Something does not seem right here.  I should be able to update my datasource any time the report needs to be refreshed, or at least have the option.  So if anyone has a complete example how to bind a report to a webservice and send parameters please post a solution.  I am trying to do something like this in the NeedDataSource is my base report:


if (string.IsNullOrEmpty(this.StoredProcedureName))
{
    base.OnNeedDataSource(sender, e);
    return;
}
 
object[] parameters = new object[this.ReportParameters.Count];
for (int index = 0; index < this.ReportParameters.Count; index++)
{
    Telerik.Reporting.ReportParameter trp = this.ReportParameters[index];
    parameters[index] = new object[] { "@" + trp.Name, trp.Value };
}
 
this.DataSource = WebServiceProxy.Execute(StoredProcedureName, parameters);

Thanks for your help,

Jason
Lars
Top achievements
Rank 1
 answered on 27 Jan 2012
4 answers
99 views
I'm trying to generate a report which uses data in a parent-child relationship.  For any Item X, it may have any number of Sub-Items.   I can set this up to work with a subreport, but then the Sub-items will only list vertically, as a subreport cannot be multi-columned. 

Also, the Sub-Items are being generated from a Stored Procedure which takes as a parameter the key of the Item.

I was hoping to overcome this by including a table in the main report which used the Stored Procedure data to list the Sub-Items, but I'm not sure how to execute the stored procedure for each item in the main report.  Can this be done?

Paul
Top achievements
Rank 1
 answered on 26 Jan 2012
8 answers
1.2K+ views
When printing a report i sometimes get this error.
Can you please give me a direction where to start?

Attempted to divide by zero.

---EXCEPTIONS----------

[DivideByZeroException]
Attempted to divide by zero.


---STACK TRACE----------

at System.Drawing.Printing.PageSettings.get_HardMarginX()
at Telerik.Reporting.Processing.ReportPrintDocument.OnBeginPrint(PrintEventArgs e)
at System.Drawing.Printing.PrintDocument._OnBeginPrint(PrintEventArgs e)
at System.Drawing.Printing.PrintController.Print(PrintDocument document)
at System.Drawing.Printing.PrintDocument.Print()
at Telerik.Reporting.Processing.ReportProcessor.PrintReport(IReportDocument reportDocument, PrinterSettings printerSettings)
at CLGroup.Intranet.Purchase.Reporting.RepBolist.PrintDocument(Int32 branchId, PersonalizationFeatureType feature, Report report)
at CLGroup.Intranet.Purchase.Reporting.RepBolist.Send_Click(Object sender, EventArgs e)
Steve
Telerik team
 answered on 26 Jan 2012
2 answers
246 views
I apologize in advance if the question was asked earlier (although I looked through the forum).
I need to completely hide the crosstab when its data source contains no records. All report controls located below should be shifted up on the page. Currently the crosstab header and footer rows are shown when no data is present. I tried to set CanShrink = true for all cells in the crosstab and use the conditional formatting (font size = 0 pt) but anyway the other report controls are on their places, not shifted up.
Nikolay
Top achievements
Rank 1
 answered on 26 Jan 2012
1 answer
550 views
Hi Telerik,

After going through Step by Step guide, I figured out ObjectDataSource is the best fit for my case.

Let me give a brief description

-> I have a wpf window (window1) with DataTable populated which needs to be displayed in the report

-> I created report with just the group header. I tried adding ObjectDataSource from the toolbar and Visual Studio got hanged. So I decided adding it in the code like below.

Telerik.Reporting.ObjectDataSource ods = new Telerik.Reporting.ObjectDataSource();

ods.DataSource = d;

Telerik.Reporting.Report r1 = new Telerik.Reporting.Report();

r1.DataSource = ods;

 

-> All the columns in the DataTable will be created and populated based on the value selected in wpf Window (window1). I would like to add this DataTable as a source to my report. 

-> How to declare the fields and association between my datatable and the display fields.

Is it something like since we know the columnnames in the DataTable we need to specify it as [=Fields.MovieName], and so on. assume MovieName is the columnName in DataTable.

Please let me know.

Thanks,
Mohan

Steve
Telerik team
 answered on 26 Jan 2012
3 answers
449 views
Hello,

I'm having troubles when i try to edit the ReportViewer's template. Basically when i click on edit template -> edit copy in blend i get the template for the ReportViewer but don't get the template for the ToolBar. I did find this template in the forums but when selecting an export option it's not doing anything. Any ideas what I'm doing wrong?

<ControlTemplate x:Key="ReportViewerControlTemplate1" TargetType="{x:Type my:ReportViewer}">
           <Grid x:Name="LayoutRoot">
               <Border BorderBrush="#3FFFFFFF" BorderThickness="1" CornerRadius="6">
                   <Border Margin="0" BorderBrush="Black" BorderThickness="1" CornerRadius="5" Padding="6">
                       <Border.Background>
                           <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                               <GradientStop Color="#FF7E7E7E" Offset="0"/>
                               <GradientStop Color="#FF484848" Offset="1"/>
                               <GradientStop Color="#FF303030" Offset="0.1"/>
                           </LinearGradientBrush>
                       </Border.Background>
                       <Grid>
                           <Grid.RowDefinitions>
                               <RowDefinition Height="Auto"/>
                               <RowDefinition Height="Auto"/>
                               <RowDefinition Height="6"/>
                               <RowDefinition Height="*"/>
                               <RowDefinition Height="6"/>
                               <RowDefinition Height="Auto"/>
                           </Grid.RowDefinitions>
                           <telerik:RadToolBar Grid.Row="0">
                               <telerik:StyleManager.Theme>
                                   <telerik:Office_BlackTheme/>
                               </telerik:StyleManager.Theme>
                               <telerik:RadButton Margin="0,2" Padding="2" Command="{Binding RefreshReportCommand}">
                                   <Image Width="16" Height="16">
                                       <Image.Source>
                                           <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/Refresh.png"/>
                                       </Image.Source>
                                   </Image>
                               </telerik:RadButton>
                               <telerik:RadToolBarSeparator/>
                               <telerik:RadButton Margin="0,2" Padding="2" Command="{Binding MoveToFirstPageCommand}">
                                   <Image Width="16" Height="16">
                                       <Image.Source>
                                           <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/FirstPage.png"/>
                                       </Image.Source>
                                   </Image>
                               </telerik:RadButton>
                               <telerik:RadButton Margin="0,2" Padding="2" Command="{Binding MoveToPreviousPageCommand}">
                                   <Image Width="16" Height="16">
                                       <Image.Source>
                                           <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/PrevPage.png"/>
                                       </Image.Source>
                                   </Image>
                               </telerik:RadButton>
                               <telerik:RadToolBarSeparator/>
                               <TextBox Margin="10,0,0,0" MinWidth="30" VerticalAlignment="Center" IsEnabled="{Binding IsMoveToPageEnabled}" Text="{Binding PageNumber, Mode=TwoWay}" TextAlignment="Center"/>
                               <TextBlock Margin="2,0,10,0" VerticalAlignment="Center" TextAlignment="Center">
                                   <TextBlock.Text>
                                       <Binding Path="PageCount" ConverterParameter="of {0} pages">
                                           <Binding.Converter>
                                               <my:FormatedNumberConverter/>
                                           </Binding.Converter>
                                       </Binding>
                                   </TextBlock.Text>
                               </TextBlock>
                               <telerik:RadToolBarSeparator/>
                               <telerik:RadButton Margin="0,2" Padding="2" Command="{Binding MoveToNextPageCommand}">
                                   <Image Width="16" Height="16">
                                       <Image.Source>
                                           <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/NextPage.png"/>
                                       </Image.Source>
                                   </Image>
                               </telerik:RadButton>
                               <telerik:RadButton Margin="0,2" Padding="2" Command="{Binding MoveToLastPageCommand}">
                                   <Image Width="16" Height="16">
                                       <Image.Source>
                                           <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/LastPage.png"/>
                                       </Image.Source>
                                   </Image>
                               </telerik:RadButton>
                               <telerik:RadToolBarSeparator/>
                               <telerik:RadButton Margin="0,2" Padding="2" Click="PrintButton_Click" > <!-- Command="{Binding PrintReportCommand}"-->
                                   <Image Width="16" Height="16">
                                       <Image.Source>
                                           <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/Print.png"/>
                                       </Image.Source>
                                   </Image>
                               </telerik:RadButton>
                               <telerik:RadComboBox ItemsSource="{Binding Path=RenderingExtensions}" Margin="1,0" Width="45" Height="24" Padding="2,0" IsEnabled="{Binding IsExportEnabled}">
                                   <telerik:RadComboBox.ItemTemplate>
                                       <DataTemplate>
                                           <TextBlock MinWidth="150" Text="{Binding Description}"/>
                                       </DataTemplate>
                                   </telerik:RadComboBox.ItemTemplate>
                                   <telerik:RadComboBox.EmptySelectionBoxTemplate>
                                       <DataTemplate>
                                           <Image HorizontalAlignment="Left" Width="16" Height="16" Visibility="Visible">
                                               <Image.Source>
                                                   <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/Export.png"/>
                                               </Image.Source>
                                           </Image>
                                       </DataTemplate>
                                   </telerik:RadComboBox.EmptySelectionBoxTemplate>
                                   <telerik:RadComboBox.SelectionBoxTemplate>
                                       <DataTemplate>
                                           <Image HorizontalAlignment="Left" Width="16" Height="16" Visibility="Visible">
                                               <Image.Source>
                                                   <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/Export.png"/>
                                               </Image.Source>
                                           </Image>
                                       </DataTemplate>
                                   </telerik:RadComboBox.SelectionBoxTemplate>
                               </telerik:RadComboBox>
                               <telerik:RadToolBarSeparator/>
                               <telerik:RadToggleButton Margin="0,2" Padding="2" IsChecked="{Binding IsDocumentMapVisible, Mode=TwoWay}">
                                   <telerik:RadToggleButton.Visibility>
                                       <Binding Path="HasDocumentMap">
                                           <Binding.Converter>
                                               <my:VisibilityConverter/>
                                           </Binding.Converter>
                                       </Binding>
                                   </telerik:RadToggleButton.Visibility>
                                   <Image Width="16" Height="16">
                                       <Image.Source>
                                           <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/DocumentMap.png"/>
                                       </Image.Source>
                                   </Image>
                               </telerik:RadToggleButton>
                               <telerik:RadToggleButton Margin="0,2" Padding="2" IsChecked="{Binding IsParametersAreaVisible, Mode=TwoWay}">
                                   <telerik:RadToggleButton.Visibility>
                                       <Binding Path="HasParameters">
                                           <Binding.Converter>
                                               <my:VisibilityConverter/>
                                           </Binding.Converter>
                                       </Binding>
                                   </telerik:RadToggleButton.Visibility>
                                   <Image Width="16" Height="16">
                                       <Image.Source>
                                           <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/Parameters.png"/>
                                       </Image.Source>
                                   </Image>
                               </telerik:RadToggleButton>
                           </telerik:RadToolBar>
                           <Border x:Name="ParametersAreaPane" Grid.Row="1">
                               <Border.Visibility>
                                   <Binding Path="IsParametersAreaVisible">
                                       <Binding.Converter>
                                           <my:VisibilityConverter/>
                                       </Binding.Converter>
                                   </Binding>
                               </Border.Visibility>
                               <Grid>
                                   <Grid>
                                       <Grid.ColumnDefinitions>
                                           <ColumnDefinition Width="*"/>
                                           <ColumnDefinition Width="Auto"/>
                                       </Grid.ColumnDefinitions>
                                       <Grid Grid.Column="0">
                                           <my:ReportParametersControl Foreground="White">
                                               <my:ReportParametersControl.ParameterTemplateSelector>
                                                   <my:ReportParameterEditorTemplateSelector>
                                                       <my:ReportParameterEditorTemplateSelector.Templates>
                                                           <DataTemplate>
                                                               <my:ParameterContentControl AvailableValues="False" Multivalue="False" Type="System.Boolean">
                                                                   <my:ParameterContentControl.Style>
                                                                       <Style TargetType="{x:Type ContentControl}">
                                                                           <Setter Property="Template">
                                                                               <Setter.Value>
                                                                                   <ControlTemplate TargetType="{x:Type ContentControl}">
                                                                                       <Grid Margin="5" Height="30">
                                                                                           <Grid.ColumnDefinitions>
                                                                                               <ColumnDefinition MinWidth="100" Width="Auto"/>
                                                                                               <ColumnDefinition Width="Auto"/>
                                                                                               <ColumnDefinition Width="Auto"/>
                                                                                           </Grid.ColumnDefinitions>
                                                                                           <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="0" Foreground="White" Text="{Binding Text}" TextWrapping="Wrap"/>
                                                                                           <ContentPresenter Margin="5,0" VerticalAlignment="Center" Grid.Column="1" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                                                                           <CheckBox VerticalAlignment="Center" Content="Null" Foreground="White" Grid.Column="2" IsChecked="{Binding IsNull, Mode=TwoWay}">
                                                                                               <CheckBox.Visibility>
                                                                                                   <Binding Path="AllowNull">
                                                                                                       <Binding.Converter>
                                                                                                           <my:VisibilityConverter/>
                                                                                                       </Binding.Converter>
                                                                                                   </Binding>
                                                                                               </CheckBox.Visibility>
                                                                                           </CheckBox>
                                                                                       </Grid>
                                                                                   </ControlTemplate>
                                                                               </Setter.Value>
                                                                           </Setter>
                                                                       </Style>
                                                                   </my:ParameterContentControl.Style>
                                                                   <CheckBox/>
                                                               </my:ParameterContentControl>
                                                           </DataTemplate>
                                                           <DataTemplate>
                                                               <my:ParameterContentControl AvailableValues="True" Multivalue="True" Type="{x:Null}">
                                                                   <my:ParameterContentControl.Style>
                                                                       <Style TargetType="{x:Type ContentControl}">
                                                                           <Setter Property="Template">
                                                                               <Setter.Value>
                                                                                   <ControlTemplate TargetType="{x:Type ContentControl}">
                                                                                       <Grid Margin="5" Height="30">
                                                                                           <Grid.ColumnDefinitions>
                                                                                               <ColumnDefinition MinWidth="100" Width="Auto"/>
                                                                                               <ColumnDefinition Width="Auto"/>
                                                                                               <ColumnDefinition Width="Auto"/>
                                                                                           </Grid.ColumnDefinitions>
                                                                                           <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="0" Foreground="White" Text="{Binding Text}" TextWrapping="Wrap"/>
                                                                                           <ContentPresenter Margin="5,0" VerticalAlignment="Center" Grid.Column="1" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                                                                           <CheckBox VerticalAlignment="Center" Content="Null" Foreground="White" Grid.Column="2" IsChecked="{Binding IsNull, Mode=TwoWay}">
                                                                                               <CheckBox.Visibility>
                                                                                                   <Binding Path="AllowNull">
                                                                                                       <Binding.Converter>
                                                                                                           <my:VisibilityConverter/>
                                                                                                       </Binding.Converter>
                                                                                                   </Binding>
                                                                                               </CheckBox.Visibility>
                                                                                           </CheckBox>
                                                                                       </Grid>
                                                                                   </ControlTemplate>
                                                                               </Setter.Value>
                                                                           </Setter>
                                                                       </Style>
                                                                   </my:ParameterContentControl.Style>
                                                                   <telerik:RadComboBox Width="200" IsDropDownOpen="{Binding IsDropDownOpen, Mode=TwoWay}">
                                                                       <telerik:RadComboBox.SelectionBoxTemplate>
                                                                           <DataTemplate>
                                                                               <TextBlock HorizontalAlignment="Stretch">
                                                                                   <TextBlock.Text>
                                                                                       <Binding Path="Owner.Value" Mode="OneWay">
                                                                                           <Binding.Converter>
                                                                                               <my:MultivalueParameterConverter/>
                                                                                           </Binding.Converter>
                                                                                       </Binding>
                                                                                   </TextBlock.Text>
                                                                               </TextBlock>
                                                                           </DataTemplate>
                                                                       </telerik:RadComboBox.SelectionBoxTemplate>
                                                                       <telerik:RadComboBox.ItemTemplate>
                                                                           <DataTemplate>
                                                                               <CheckBox Content="{Binding Name}" IsChecked="{Binding IsSelected, Mode=TwoWay}"/>
                                                                           </DataTemplate>
                                                                       </telerik:RadComboBox.ItemTemplate>
                                                                       <telerik:StyleManager.Theme>
                                                                           <telerik:Office_BlackTheme/>
                                                                       </telerik:StyleManager.Theme>
                                                                   </telerik:RadComboBox>
                                                               </my:ParameterContentControl>
                                                           </DataTemplate>
                                                           <DataTemplate>
                                                               <my:ParameterContentControl AvailableValues="True" Multivalue="False" Type="{x:Null}">
                                                                   <my:ParameterContentControl.Style>
                                                                       <Style TargetType="{x:Type ContentControl}">
                                                                           <Setter Property="Template">
                                                                               <Setter.Value>
                                                                                   <ControlTemplate TargetType="{x:Type ContentControl}">
                                                                                       <Grid Margin="5" Height="30">
                                                                                           <Grid.ColumnDefinitions>
                                                                                               <ColumnDefinition MinWidth="100" Width="Auto"/>
                                                                                               <ColumnDefinition Width="Auto"/>
                                                                                               <ColumnDefinition Width="Auto"/>
                                                                                           </Grid.ColumnDefinitions>
                                                                                           <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="0" Foreground="White" Text="{Binding Text}" TextWrapping="Wrap"/>
                                                                                           <ContentPresenter Margin="5,0" VerticalAlignment="Center" Grid.Column="1" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                                                                           <CheckBox VerticalAlignment="Center" Content="Null" Foreground="White" Grid.Column="2" IsChecked="{Binding IsNull, Mode=TwoWay}">
                                                                                               <CheckBox.Visibility>
                                                                                                   <Binding Path="AllowNull">
                                                                                                       <Binding.Converter>
                                                                                                           <my:VisibilityConverter/>
                                                                                                       </Binding.Converter>
                                                                                                   </Binding>
                                                                                               </CheckBox.Visibility>
                                                                                           </CheckBox>
                                                                                       </Grid>
                                                                                   </ControlTemplate>
                                                                               </Setter.Value>
                                                                           </Setter>
                                                                       </Style>
                                                                   </my:ParameterContentControl.Style>
                                                                   <telerik:RadComboBox Width="200">
                                                                       <telerik:StyleManager.Theme>
                                                                           <telerik:Office_BlackTheme/>
                                                                       </telerik:StyleManager.Theme>
                                                                       <telerik:RadComboBox.ItemTemplate>
                                                                           <DataTemplate>
                                                                               <TextBlock Text="{Binding Name}"/>
                                                                           </DataTemplate>
                                                                       </telerik:RadComboBox.ItemTemplate>
                                                                   </telerik:RadComboBox>
                                                               </my:ParameterContentControl>
                                                           </DataTemplate>
                                                           <DataTemplate>
                                                               <my:ParameterContentControl AvailableValues="False" Multivalue="False" Type="System.DateTime">
                                                                   <my:ParameterContentControl.Style>
                                                                       <Style TargetType="{x:Type ContentControl}">
                                                                           <Setter Property="Template">
                                                                               <Setter.Value>
                                                                                   <ControlTemplate TargetType="{x:Type ContentControl}">
                                                                                       <Grid Margin="5" Height="30">
                                                                                           <Grid.ColumnDefinitions>
                                                                                               <ColumnDefinition MinWidth="100" Width="Auto"/>
                                                                                               <ColumnDefinition Width="Auto"/>
                                                                                               <ColumnDefinition Width="Auto"/>
                                                                                           </Grid.ColumnDefinitions>
                                                                                           <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="0" Foreground="White" Text="{Binding Text}" TextWrapping="Wrap"/>
                                                                                           <ContentPresenter Margin="5,0" VerticalAlignment="Center" Grid.Column="1" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                                                                           <CheckBox VerticalAlignment="Center" Content="Null" Foreground="White" Grid.Column="2" IsChecked="{Binding IsNull, Mode=TwoWay}">
                                                                                               <CheckBox.Visibility>
                                                                                                   <Binding Path="AllowNull">
                                                                                                       <Binding.Converter>
                                                                                                           <my:VisibilityConverter/>
                                                                                                       </Binding.Converter>
                                                                                                   </Binding>
                                                                                               </CheckBox.Visibility>
                                                                                           </CheckBox>
                                                                                       </Grid>
                                                                                   </ControlTemplate>
                                                                               </Setter.Value>
                                                                           </Setter>
                                                                       </Style>
                                                                   </my:ParameterContentControl.Style>
                                                                   <telerik:RadDatePicker Width="200" IsTabStop="False" DisplayDate="2010-05-01" SelectedDate="{Binding Value, Mode=TwoWay}">
                                                                       <telerik:StyleManager.Theme>
                                                                           <telerik:Office_BlackTheme/>
                                                                       </telerik:StyleManager.Theme>
                                                                   </telerik:RadDatePicker>
                                                               </my:ParameterContentControl>
                                                           </DataTemplate>
                                                           <DataTemplate>
                                                               <my:ParameterContentControl AvailableValues="False" Multivalue="False" Type="{x:Null}">
                                                                   <my:ParameterContentControl.Style>
                                                                       <Style TargetType="{x:Type ContentControl}">
                                                                           <Setter Property="Template">
                                                                               <Setter.Value>
                                                                                   <ControlTemplate TargetType="{x:Type ContentControl}">
                                                                                       <Grid Margin="5" Height="30">
                                                                                           <Grid.ColumnDefinitions>
                                                                                               <ColumnDefinition MinWidth="100" Width="Auto"/>
                                                                                               <ColumnDefinition Width="Auto"/>
                                                                                               <ColumnDefinition Width="Auto"/>
                                                                                           </Grid.ColumnDefinitions>
                                                                                           <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="0" Foreground="White" Text="{Binding Text}" TextWrapping="Wrap"/>
                                                                                           <ContentPresenter Margin="5,0" VerticalAlignment="Center" Grid.Column="1" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                                                                           <CheckBox VerticalAlignment="Center" Content="Null" Foreground="White" Grid.Column="2" IsChecked="{Binding IsNull, Mode=TwoWay}">
                                                                                               <CheckBox.Visibility>
                                                                                                   <Binding Path="AllowNull">
                                                                                                       <Binding.Converter>
                                                                                                           <my:VisibilityConverter/>
                                                                                                       </Binding.Converter>
                                                                                                   </Binding>
                                                                                               </CheckBox.Visibility>
                                                                                           </CheckBox>
                                                                                       </Grid>
                                                                                   </ControlTemplate>
                                                                               </Setter.Value>
                                                                           </Setter>
                                                                       </Style>
                                                                   </my:ParameterContentControl.Style>
                                                                   <TextBox Width="200" Text="{Binding Value, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}"/>
                                                               </my:ParameterContentControl>
                                                           </DataTemplate>
                                                       </my:ReportParameterEditorTemplateSelector.Templates>
                                                   </my:ReportParameterEditorTemplateSelector>
                                               </my:ReportParametersControl.ParameterTemplateSelector>
                                               <my:ReportParametersControl.ItemsPanel>
                                                   <ItemsPanelTemplate>
                                                       <Telerik_Windows_Controls_Primitives:RadUniformGrid IsItemsHost="True" Columns="2"/>
                                                   </ItemsPanelTemplate>
                                               </my:ReportParametersControl.ItemsPanel>
                                           </my:ReportParametersControl>
                                       </Grid>
                                       <Grid HorizontalAlignment="Center" VerticalAlignment="Bottom" Grid.Column="1">
                                           <telerik:RadButton Margin="3" Content="Preview" Padding="10,3" Command="{Binding PreviewReportCommand}">
                                               <telerik:StyleManager.Theme>
                                                   <telerik:Office_BlackTheme/>
                                               </telerik:StyleManager.Theme>
                                           </telerik:RadButton>
                                       </Grid>
                                   </Grid>
                                   <my:DialogBox x:Name="UpdateParametersDialog">
                                       <my:DialogBox.Visibility>
                                           <Binding Path="IsUpdatingParameters">
                                               <Binding.Converter>
                                                   <my:VisibilityConverter/>
                                               </Binding.Converter>
                                           </Binding>
                                       </my:DialogBox.Visibility>
                                       <Grid Margin="20">
                                           <Grid.RowDefinitions>
                                               <RowDefinition/>
                                               <RowDefinition Height="Auto"/>
                                           </Grid.RowDefinitions>
                                           <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding UpdateParametersProgress}"/>
                                           <telerik:RadProgressBar Grid.Row="1" Maximum="100">
                                               <telerik:StyleManager.Theme>
                                                   <telerik:Office_BlackTheme/>
                                               </telerik:StyleManager.Theme>
                                               <telerik:RadProgressBar.Style>
                                                   <Style TargetType="{x:Type telerik:RadProgressBar}">
                                                       <Setter Property="IsIndeterminate" Value="True"/>
                                                       <Setter Property="Height" Value="10"/>
                                                       <Setter Property="Margin" Value="0,10,0,0"/>
                                                       <Setter Property="IsTabStop" Value="False"/>
                                                   </Style>
                                               </telerik:RadProgressBar.Style>
                                           </telerik:RadProgressBar>
                                       </Grid>
                                   </my:DialogBox>
                               </Grid>
                           </Border>
                           <Grid Grid.Row="3">
                               <Grid.ColumnDefinitions>
                                   <ColumnDefinition Width="Auto"/>
                                   <ColumnDefinition Width="*"/>
                               </Grid.ColumnDefinitions>
                               <Border x:Name="DocumentMapPane" Width="200" Grid.Column="0">
                                   <Border.Visibility>
                                       <Binding Path="IsDocumentMapVisible">
                                           <Binding.Converter>
                                               <my:VisibilityConverter/>
                                           </Binding.Converter>
                                       </Binding>
                                   </Border.Visibility>
                                   <Border Margin="0,0,6,0" Grid.Column="2" BorderBrush="#66FFFFFF" BorderThickness="1" CornerRadius="4">
                                       <Border Margin="0" Background="White" BorderBrush="Black" BorderThickness="1" CornerRadius="3">
                                           <telerik:RadTreeView x:Name="DocumentMapTreeView" Background="White" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" IsVirtualizing="False" TextDropAfter="Drop after " TextDropBefore="Drop before " TextDropIn="Drop in " TextDropRoot="Drop as root">
                                               <telerik:RadTreeView.ItemTemplate>
                                                   <HierarchicalDataTemplate AlternationCount="0" ItemBindingGroup="{x:Null}" ItemContainerStyle="{x:Null}" ItemContainerStyleSelector="{x:Null}" ItemStringFormat="{x:Null}" ItemTemplate="{x:Null}" ItemTemplateSelector="{x:Null}" ItemsSource="{Binding Children}">
                                                       <TextBlock Text="{Binding Label}"/>
                                                   </HierarchicalDataTemplate>
                                               </telerik:RadTreeView.ItemTemplate>
                                               <telerik:RadTreeView.Style>
                                                   <Style TargetType="{x:Type telerik:RadTreeView}">
                                                       <Setter Property="IsEnabled" Value="{Binding IsMoveToPageEnabled}"/>
                                                       <Setter Property="SelectedItem" Value="{Binding SelectedDocumentMapNode, Mode=TwoWay}"/>
                                                       <Setter Property="ItemsSource" Value="{Binding DocumentMapNodes}"/>
                                                   </Style>
                                               </telerik:RadTreeView.Style>
                                               <telerik:StyleManager.Theme>
                                                   <telerik:Office_BlackTheme/>
                                               </telerik:StyleManager.Theme>
                                           </telerik:RadTreeView>
                                       </Border>
                                   </Border>
                               </Border>
                               <Border Grid.Column="2" BorderBrush="#66FFFFFF" BorderThickness="1" CornerRadius="4">
                                   <Border Margin="0" Background="White" BorderBrush="Black" BorderThickness="1" CornerRadius="3">
                                       <Grid>
                                           <ScrollViewer x:Name="PageScrollViewer" BorderThickness="0" Visibility="Visible" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Visible">
                                               <Border x:Name="PageBorder" Margin="10" Width="{Binding PageWidth}" Height="{Binding PageHeight}" Background="White" BorderBrush="DarkGray" BorderThickness="1">
                                                   <Telerik_Windows_Controls_Primitives:LayoutTransformControl x:Name="PageContainer" Content="{Binding PageRoot}" IsTabStop="False" LayoutTransform="{Binding PageTransform}"/>
                                               </Border>
                                           </ScrollViewer>
                                           <my:DialogBox x:Name="ViewerProgressMessage">
                                               <my:DialogBox.Visibility>
                                                   <Binding Path="IsInProgress">
                                                       <Binding.Converter>
                                                           <my:VisibilityConverter/>
                                                       </Binding.Converter>
                                                   </Binding>
                                               </my:DialogBox.Visibility>
                                               <Grid Margin="20">
                                                   <Grid.RowDefinitions>
                                                       <RowDefinition/>
                                                       <RowDefinition Height="Auto"/>
                                                   </Grid.RowDefinitions>
                                                   <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding ProgressMessage}"/>
                                                   <telerik:RadProgressBar Grid.Row="1" Maximum="100">
                                                       <telerik:StyleManager.Theme>
                                                           <telerik:Office_BlackTheme/>
                                                       </telerik:StyleManager.Theme>
                                                       <telerik:RadProgressBar.Style>
                                                           <Style TargetType="{x:Type telerik:RadProgressBar}">
                                                               <Setter Property="IsIndeterminate" Value="True"/>
                                                               <Setter Property="Height" Value="10"/>
                                                               <Setter Property="Margin" Value="0,10,0,0"/>
                                                               <Setter Property="IsTabStop" Value="False"/>
                                                           </Style>
                                                       </telerik:RadProgressBar.Style>
                                                   </telerik:RadProgressBar>
                                               </Grid>
                                           </my:DialogBox>
                                           <TextBox x:Name="ViewerError" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="White" BorderThickness="0" FontFamily="Verdana" Foreground="Gray" Padding="20" Text="{Binding Error}" TextAlignment="Center" TextWrapping="Wrap" IsReadOnly="True">
                                               <TextBox.Visibility>
                                                   <Binding Path="HasError">
                                                       <Binding.Converter>
                                                           <my:VisibilityConverter/>
                                                       </Binding.Converter>
                                                   </Binding>
                                               </TextBox.Visibility>
                                           </TextBox>
                                           <my:DialogBox x:Name="ExportDialog">
                                               <my:DialogBox.Visibility>
                                                   <Binding Path="ShowExportDialog">
                                                       <Binding.Converter>
                                                           <my:VisibilityConverter/>
                                                       </Binding.Converter>
                                                   </Binding>
                                               </my:DialogBox.Visibility>
                                               <Grid Width="300" Height="120">
                                                   <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                                                       <Grid.RowDefinitions>
                                                           <RowDefinition Height="70"/>
                                                           <RowDefinition Height="50"/>
                                                       </Grid.RowDefinitions>
                                                       <StackPanel VerticalAlignment="Bottom" Grid.Row="0" Orientation="Vertical">
                                                           <TextBlock HorizontalAlignment="Center" FontWeight="Bold" Text="{Binding ExportProgress}"/>
                                                           <telerik:RadProgressBar x:Name="ExportProgressBar" HorizontalAlignment="Center" Width="260" Maximum="100">
                                                               <telerik:StyleManager.Theme>
                                                                   <telerik:Office_BlackTheme/>
                                                               </telerik:StyleManager.Theme>
                                                               <telerik:RadProgressBar.Style>
                                                                   <Style TargetType="{x:Type telerik:RadProgressBar}">
                                                                       <Setter Property="IsIndeterminate" Value="True"/>
                                                                       <Setter Property="Height" Value="10"/>
                                                                       <Setter Property="Margin" Value="0,10,0,0"/>
                                                                       <Setter Property="IsTabStop" Value="False"/>
                                                                   </Style>
                                                               </telerik:RadProgressBar.Style>
                                                           </telerik:RadProgressBar>
                                                       </StackPanel>
                                                       <telerik:RadButton VerticalAlignment="Center" Width="100" Content="Cancel" Grid.Row="2" Command="{Binding CancelExportCommand}">
                                                           <telerik:StyleManager.Theme>
                                                               <telerik:Office_BlackTheme/>
                                                           </telerik:StyleManager.Theme>
                                                       </telerik:RadButton>
                                                   </Grid>
                                               </Grid>
                                           </my:DialogBox>
                                       </Grid>
                                   </Border>
                               </Border>
                           </Grid>
                           <Grid Grid.Row="5">
                               <Grid.ColumnDefinitions>
                                   <ColumnDefinition Width="*"/>
                                   <ColumnDefinition Width="Auto"/>
                               </Grid.ColumnDefinitions>
                               <StackPanel VerticalAlignment="Center" Grid.Column="1" Orientation="Horizontal">
                                   <telerik:RadSlider VerticalAlignment="Center" Width="200" IsEnabled="True" Maximum="100" Minimum="-100" SmallChange="10" EnableSideTicks="True" HandlesVisibility="Visible">
                                       <telerik:RadSlider.Value>
                                           <Binding Path="Zoom" Mode="TwoWay">
                                               <Binding.Converter>
                                                   <my:ScaleFactorConverter/>
                                               </Binding.Converter>
                                           </Binding>
                                       </telerik:RadSlider.Value>
                                       <telerik:StyleManager.Theme>
                                           <telerik:Office_BlackTheme/>
                                       </telerik:StyleManager.Theme>
                                   </telerik:RadSlider>
                                   <telerik:RadComboBox IsTabStop="False">
                                       <telerik:StyleManager.Theme>
                                           <telerik:Office_BlackTheme/>
                                       </telerik:StyleManager.Theme>
                                       <telerik:RadComboBox.Style>
                                           <Style TargetType="{x:Type telerik:RadComboBox}">
                                               <Setter Property="Margin" Value="10,0,3,0"/>
                                               <Setter Property="Width" Value="70"/>
                                               <Setter Property="HorizontalAlignment" Value="Center"/>
                                               <Setter Property="VerticalAlignment" Value="Center"/>
                                               <Setter Property="IsEditable" Value="True"/>
                                               <Setter Property="IsTextSearchEnabled" Value="False"/>
                                               <Setter Property="MaxDropDownHeight" Value="300"/>
                                               <Setter Property="ItemsSource">
                                                   <Setter.Value>
                                                       <Binding Path="AvailableZoomValues">
                                                           <Binding.Converter>
                                                               <my:ZoomConverter/>
                                                           </Binding.Converter>
                                                       </Binding>
                                                   </Setter.Value>
                                               </Setter>
                                               <Setter Property="Text">
                                                   <Setter.Value>
                                                       <Binding Path="Zoom" Mode="TwoWay">
                                                           <Binding.Converter>
                                                               <my:ZoomConverter/>
                                                           </Binding.Converter>
                                                       </Binding>
                                                   </Setter.Value>
                                               </Setter>
                                           </Style>
                                       </telerik:RadComboBox.Style>
                                   </telerik:RadComboBox>
                               </StackPanel>
                           </Grid>
                       </Grid>
                   </Border>
               </Border>
           </Grid>
       </ControlTemplate>

Thanks much,
~Boots
Ristogod
Top achievements
Rank 2
 answered on 25 Jan 2012
8 answers
820 views
I'm creating a project in VisualStudio 2005 that uses a WebForms ReportViewer.  It runs just fine locally when debugging with VS.  I deployed it to a server and can bring up the page with the ReportViewer just fine.  And I know it's connecting to the database OK because one of the parameters populates via a stored procedure, and quite quickly.  The stored procedure that drives the report itself also should return quickly - it does when I run it directly with the parameters the report would send it.  But when I try to run the report it hangs for about 30 seconds and then displays this:
An error has occured while processing Report '': 
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. 


Steve
Telerik team
 answered on 25 Jan 2012
4 answers
241 views
Is there a way to execute functions (next page, previous page, first page, toggle ViewMode, print etc.) of the WPF ReportViewer programmatically?

We embed the viewer in a larger UI application and we want to use the viewer to display the report, but the controls of our own enveloping application to control its functions.

When I look at the ReportViewer source code, its controls bind to its view model which in turn is private. Is there no way to execute the "next page" command (for example) programmatically externally?
IvanY
Telerik team
 answered on 25 Jan 2012
1 answer
126 views

I need to create a report with a data section that appears only at the bottom of the first page of a PDF report. From reading other posts it appears that the only way to do this is to put the fields into the page footer and then add values to the fields in ItemDataBound event of the footer. I've tried doing this, but the data doesn't appear on the first page, only on subsequent pages. Any ideas why this isn't working? Is this the proper way to go about this?

Here's a simplified view of what I'm doing.

private void pageFooter_ItemDataBound(object sender, EventArgs e)
{
  barcode1.Value = "123456"; 
  barcode2.Value = "234567"; 
  barcode3.Value = "345678"; 
  barcode4.Value = "456789"; 
  barcode5.Value = "567890"; 
  barcode6.Value = "678901"; 
  barcode7.Value = "789012"; 
  barcode8.Value = "890123"; 
  barcode9.Value = "901234"; 
}

I also want to suppress the display on pages other than page one. Can I toggle the visibility with conditional formatting based on PageNumber or is there a better way?

Thanks,

John

Elian
Telerik team
 answered on 25 Jan 2012
4 answers
126 views
Hi All,

I'm new to Telerik reporting and this is going to be my first report. Here is my req. I need to create a report which contains 45 columns. I had placed all the columns in the page header section by increasing report width as well as changing the same in PageWidth of the designer. When I clicked on preview it is showing only the columns that is going to be on the page1, it is not rendering the rest of the columns. I did checked in other pages also it's not showing up. what may be the issues.

Also in my wpf application when I click on a button then I need to open a  new window which has report viewer control on it. So I will pass datatable from window1 to window2 and then window2 will assign the datasource of the report as datatable. This is my idea. Is it possible or not. if possible how can I assign the field mappings.

Please let me know what are the ways to pass datasource at runtime and how to assign the mapping between the fields.

Thanks,
Mohan
Mohan
Top achievements
Rank 1
 answered on 25 Jan 2012
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?