<AppointmentTemplate> <div class="rsCustomAppointmentContainer"> <a href="finance.aspx"> <%# Eval("FinancialLink.Text")%></a> <div> </div> </div> </AppointmentTemplate> <ResourceTypes> <telerik:ResourceType KeyField="FinancialLogID" Name="FinancialLink" TextField="FinancialLogNumber" ForeignKeyField="FinancialLogID" DataSourceID="EntityDataSource3" /> </ResourceTypes><telerik:RadScheduler ID="RadScheduler2" runat="server" DataEndField="DateEntered" DataKeyField="FinancialLogID" Height="558px" DataStartField="DateEntered" EnableEmbeddedSkins="true" EnableViewState="true" DataSourceID="EntityDataSource3" StartEditingInAdvancedForm="false" DataSubjectField="FinancialLogNumber" HoursPanelTimeFormat="htt" Skin="Web20" ValidationGroup="RadScheduler1" ShowFooter="true" SelectedView="MonthView" Width="670px" ShowFullTime="true" RowHeight="23px" AllowDelete="False" AllowInsert="False" Visible="False"> <AppointmentTemplate> <div class="rsCustomAppointmentContainer"> <a href="finance.aspx"> <%# Eval("FinancialLink.Text")%></a> <div> </div> </div> </AppointmentTemplate> <ResourceTypes> <telerik:ResourceType KeyField="FinancialLogID" Name="FinancialLink" TextField="FinancialLogNumber"ForeignKeyField="FinancialLogID" DataSourceID="EntityDataSource3" /> </ResourceTypes> <WeekView HeaderDateFormat="dd MMM yy" /> <MonthView HeaderDateFormat="MMM yy" /> <DayView HeaderDateFormat="dddd, MMM d, yy" /> <TimelineView UserSelectable="false" /> </telerik:RadScheduler><telerik:RadPanelBar ID="AccountPanels" runat="server" Width="100%" ExpandMode="FullExpandedItem"> <Items> <telerik:RadPanelItem Text="Design History" runat="server" Expanded="True"> <Items> <telerik:RadPanelItem runat="server" Value="OrderHistory"> <ItemTemplate> <div style="height:350px; overflow-x:hidden; overflow-y:auto;"> <div style="width:97%;"> <div> <asp:Label ID="lblOpenItems" runat="server" Text="If you have any open unsaved items, they will show up in the grid below. You can choose to edit, save and add to your cart.<br />Or you can choose to remove the item(s) permanently."></asp:Label><br /><br /> </div> <asp:Panel ID="PnlOpenItems" runat="server"> <telerik:RadAjaxManagerProxy ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="grdOpenItems"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="grdOpenItems" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManagerProxy> <telerik:RadGrid ID="grdOpenItems" OnNeedDataSource="Item_NeedDataSource" OnItemDataBound="Item_ItemDataBound" runat="server" AutoGenerateColumns="false" AllowPaging="false"> <ClientSettings> <Scrolling AllowScroll="True" ScrollHeight="150px" UseStaticHeaders="true" /> </ClientSettings> <MasterTableView NoMasterRecordsText="You have no unsaved items at this time."> <Columns> <telerik:GridBoundColumn HeaderText="Customer ID" DataField="EntityContactNumber" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="Custom ID" DataField="CustomID"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="Item Number" DataField="ItemNumber"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="Template Name" DataField="FriendlyName"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="Date Created" DataField="DateAdded"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="DateModified" DataField="DateModified" Visible="False"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="CartId" DataField="CartId" Visible="False"> </telerik:GridBoundColumn> <telerik:GridButtonColumn UniqueName="btnEdit" HeaderText="Edit" DataTextField="ItemNumber"> </telerik:GridButtonColumn> <telerik:GridButtonColumn UniqueName="btnDelete" HeaderText="Remove" DataTextField="CustomID"> </telerik:GridButtonColumn> </Columns> </MasterTableView> </telerik:RadGrid> </asp:Panel> </div> </div> </ItemTemplate> </telerik:RadPanelItem> </Items> </telerik:RadPanelItem> <telerik:RadPanelItem Text="Previously Shipped Designs" Expanded="True" runat="server"> <Items> <telerik:RadPanelItem runat="server" Value="MyProfile" Height="400px"> <ItemTemplate> <telerik:RadAjaxPanel ID="ProfileAjax" runat="server"> <div style="height:350px;overflow-x:hidden;overflow-y:auto;"> <div style="width:97%;"> </div> </div> <asp:Panel ID="ProfileMessageHolder" runat="server" Visible="false" HorizontalAlign="Center"> <strong>Your profile has been saved</strong> </asp:Panel> </telerik:RadAjaxPanel> </ItemTemplate> </telerik:RadPanelItem> </Items> </telerik:RadPanelItem> </Items></telerik:RadPanelBar>ExcelMLExportStylesCreated event but it gives me an error message Object reference not set to an instance of an object. on this line
- borderStyle.PositionType = DirectCast(i, PositionType)
Also I can't figure out how to apply the style to the header row.
Dim cstyle As New StyleElement("MyCustomStyle") Dim borders As New BorderStylesCollection() Dim borderStyle As BorderStyles For i As Integer = 1 To 4 'four borders borderStyle.PositionType = DirectCast(i, PositionType) borderStyle.Color = System.Drawing.Color.Black borderStyle.LineStyle = LineStyle.Continuous borderStyle.Weight = 1.0R borders.Add(borderStyle) Next For Each border As BorderStyles In borders cstyle.Borders.Add(border) Next e.Styles.Add(cstyle)
2. How can I insert a row at the beginning of the output. I have seen many examples on how to do this when using the HTML format but there are no examples when using the ExportML format. The following can be used for the HTML format but there is no <body> tag in when you use the ExportML
Protected Sub rgSummaryReport_GridExporting(source As Object, e As Telerik.Web.UI.GridExportingArgs)
Dim title As String = If(_reportCriteria.AppIsFinalSubmitted, " Final-Submission Report", "Pre-Submission Report")
Dim strHeader As New StringBuilder("<h3><center>" + title + "</center></h3><br>")
strHeader.Append("<h5><b>Contract ID: " + Session("contract_id") + "<br>")
strHeader.Append("Contract Name: " + Session("contract_name") + "<br><br>")
strHeader.Append("Report data is valid as of " + lblReportTimestamp.Text + "</b></h5>")
e.ExportOutput = e.ExportOutput.Replace("<head>", "<head><style type=""text/css"">td {border: 0.1pt solid #000000;}</style>")
e.ExportOutput = e.ExportOutput.Replace("<body>", "<body>" + strHeader.ToString())
e.ExportOutput = e.ExportOutput.Replace("</body>", "Report Downloaded: " + DateTime.Now.ToString() + "</body>")
End Sub
Thank you for your help.
Tracy