Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
176 views
Hi,

I am exporting a RadGrid and directing the output to a server file in the OnGridExporting event.
The file is successfully created and if I open it with NotePad the file does in fact begin with %PDF-.
But when I attempt to open it in my browser, I get the error you see in the title of this thread.
I cannot open it directly with Adobe Reader either.

I used the technique identified in this thread to create the file (although it was for an xls file):

Here are the relevant code pieces:

Declaration:
<telerik:RadGrid ID="grdRACI" Skin="Outlook" GridLines="Both" runat="server" AutoGenerateColumns="true" OnGridExporting="grdRACI_Exporting"
                            OnItemDataBound="grdRACI_ItemDataBound" OnColumnCreated="grdRACI_ColumnCreated" >
                            <MasterTableView NoMasterRecordsText="No responsibilities defined" NoDetailRecordsText="No responsibilities defined">
                            </MasterTableView>
                            <ClientSettings>
                                <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                                <Resizing AllowColumnResize="true" AllowResizeToFit="true" ResizeGridOnColumnResize="true" />
                            </ClientSettings>
                            <ExportSettings OpenInNewWindow="false" HideStructureColumns="true">
                            </ExportSettings>
                        </telerik:RadGrid>

Code that performs the export:
...
grdRACI.ExportSettings.Pdf.PageTitle = "RACI Chart For - " + Session["currentProcessName"].ToString();
        grdRACI.ExportSettings.Pdf.DefaultFontFamily = "Arial Narrow";
        grdRACI.ExportSettings.Pdf.PageLeftMargin = Unit.Parse("0.25in");
        grdRACI.ExportSettings.Pdf.PageRightMargin = Unit.Parse("0.25in");
        Session["RACI_PDF_Filename"] = "ExternalDocs/" + "RACI_Chart_ For_" + Session["currentProcessName"].ToString() + " - " + DateTime.Now.ToString("ddMMMyyyy-HHmm") + ".pdf";
        grdRACI.MasterTableView.ExportToPdf();
...

Code that creates the file:
protected void grdRACI_Exporting(object source, GridExportingArgs e)
    {
        string path = Server.MapPath("~/" + Session["RACI_PDF_Filename"].ToString());
        using (FileStream fs = File.Create(path))
        {
            Byte[] info = System.Text.Encoding.Unicode.GetBytes(e.ExportOutput);
            fs.Write(info, 0, info.Length);
        }
        Response.Redirect(Request.Url.ToString());
    }


What am I doing wrong?

Thanks in advance for any suggestions.

Jim
jlj30
Top achievements
Rank 2
 answered on 19 Mar 2014
1 answer
293 views
Is it possible to use the mask with the password text mode?  A quick attempt reveals everything shows up as password dot.
Thanks!
Maria Ilieva
Telerik team
 answered on 19 Mar 2014
1 answer
80 views
Hi.
i want to export to excel with a text at the end of grid.how to achieve this??
Shinu
Top achievements
Rank 2
 answered on 19 Mar 2014
4 answers
170 views
I have a Hierarchical Grid with a CommandItemTemplate defined in the GridTableView so that each child table has the same Button control that when clicked will reset its filter columns.  What I can't figure out is how to get a reference to the parent GridTableView of the button in the server side button click.

I know how to traverse the ALL the child GridTableViews but I just want to reset the column filters on the GridTableView that the button was clicked in.  To do that I need a reference to the parent GridTableView of the button.  Any ideas how I can get a reference to that?

john81
Top achievements
Rank 1
 answered on 19 Mar 2014
3 answers
130 views
My site has RTL layout.
I use RadMenu on the site for a long time and it was fine.
Now I've set the menu drop-down to contain two columns, and since then there is a strange problem:
In IE8 and Firefox - for the first time the drop-down menu appears to the right of the item that opens
it
, and only the second time and on - it appears on the left. (- This is the proper look for RTL)
This is particularly problematic in the first items on the menu because then the right part of the
pop-up menu appears off screen.
In Chrome - There is no difference between the first time and the other times, but it's always not aligned with the item that opens
it
.
Is it a known bug?
How can I solve it?
Thank you.
banana
Top achievements
Rank 1
 answered on 19 Mar 2014
8 answers
301 views
Hi
Firstly I am facing so many rendering problems in IE8 (We are ignoring IE7 so no need to support in that bug browser).

Here I am attaching an image please refer.
To remove this white space I had try this property in CSS

#rgVessel_GridHeader, .rgHeaderDiv {margin-right:0!important}

It works but the alignment of Grid vertical line disturbed. Is it right hack for removing this white space? Then
How we can restore the Grid Vertical Lines.?

Please help us.
Thanks in Advanve

vargis
mailtovargis@gmail.com
Venelin
Telerik team
 answered on 19 Mar 2014
13 answers
152 views
In my Project I'm using a RadSchedular where currently highlighting  of vertical columns is only poosible.
The requirement is of highlighting of horizontal column as well along with the vertical one when the the cursor is placed on particular cell.

Attached is the display of  the Image from part of the Schedular in browser. Suppose now if the cursor is placed on 52 CW only particular row is highlighted ,the requirement is of highlighting of columns as well paralleled.

Below is the code snippet for the RadSchedular 
<telerik:RadPane ID="RadPane2" runat="server" OnClientResized="PaneResized" Height="100%"
      Scrolling="None" MinWidth="200" OnClientCollapsing="CollapseToMinWidth" OnClientBeforeExpand="ExpandFromMinWidth">
      <telerik:RadScheduler ID="SPScheduler" runat="server" SelectedView="TimelineView"
          FirstDayOfWeek="Monday" LastDayOfWeek="Friday" OverflowBehavior="Scroll" OnClientAppointmentMoveEnd="OnAppoinmentMoveEnd"
          OnClientAppointmentResizeStart="OnAppoinmentResizeStart" OnClientAppointmentInserting="OnAppointmentInserting"
          DataEndField="End" DataKeyField="ID" OnClientFormCreated="OnFormCreated" DataStartField="Start"
          DataSubjectField="Phase" CustomAttributeNames="Iteration,Servers,DBType" StartEditingInAdvancedForm="True"
          StartInsertingInAdvancedForm="True" OnAppointmentDelete="SPScheduler_AppointmentDelete"
          OnAppointmentInsert="SPScheduler_AppointmentInsert" OnAppointmentUpdate="SPScheduler_AppointmentUpdate"
          OnAppointmentDataBound="SPScheduler_AppointmentDataBound" OnAppointmentCommand="SPScheduler_AppointmentCommand"
          OnNavigationCommand="SPScheduler_NavigationCommand" OnTimeSlotCreated="SPScheduler_TimeSlotCreated"
          OnFormCreated="SPScheduler_FormCreated" ShowResourceHeaders="False" OnPreRender="SPScheduler_PreRender"
          OnNavigationComplete="SPScheduler_NavigationComplete" Height="100%" MinimumInlineFormHeight="500"
          MinimumInlineFormWidth="200" Skin="Simple">
          <DayView UserSelectable="false" />
          <WeekView UserSelectable="false" />
          <MonthView UserSelectable="false" />
          <TimelineView NumberOfSlots="35" SlotDuration="7.00:00:00" GroupingDirection="Vertical"
              GroupBy="Order" ShowInsertArea="false" /,


  
Farjana
Top achievements
Rank 1
 answered on 19 Mar 2014
8 answers
525 views
I have a web page that uses jquery.load() to load different pages into a div.

When I invoke the .load command, it loads the page perfectly into a div, but it throws an error saying that "$telerik is undefined"

On the main page, I have a link that does this when you click it...

changeTab: function (tabURL) {
        var loader = $("#tabLoad");
        var content = $("div[id$='pnlTabContent']");
        loader.css("height", content.height());
        loader.fadeIn('fast', function () {
            content.load(tabURL, function () {
                loader.fadeOut("fast");
            });
        });
    }

When I call that function, I pass in a URL that has a bunch of telerik sliders on it. Everything shows up and works properly (all CSS and self defined JavaScript) except the telerik controls.

The strange thing is that when I invoke the function again or if I call "content.load(tabURL)" a second time, everything loads fine and all the telerik controls load perfectly.

It seems as if it has to load the telerik library the first time, and the second time, it will work.

Is there any way for me to load the telerik library or initialize telerik before I call the content.load() function?

Niko
Telerik team
 answered on 19 Mar 2014
5 answers
242 views
Is it possible to have the WindowManager within the FileExplorer have a different skin?

I am setting the following in code:

            rfeExplorer.Upload.Skin = "Default"
            rfeExplorer.WindowManager.Skin = "Default"

The FileExplorer has a Web20 setting, but appears as though the WindowManager ignores it.
Vessy
Telerik team
 answered on 19 Mar 2014
1 answer
509 views
I am trying to format a RadGrid which contains 4 columns. I have a few issues that I don't know how to fix.
1)I want to format that information so that it aligns with the columns
2)How do I change the background color so that it is alternating colors, right now they are all a gray color
3)I want to get rid of the Client number sorting (keep the grouping) and sort by Date of Decline DESCENDING

Here is the code that I have so far:
​<%@ Page Title="Report" Language="C#" MasterPageFile="~/MasterPages/Site.Master" AutoEventWireup="true" CodeBehind="Report.aspx.cs" Inherits="Report" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
 
<div>
 <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" AllowFilteringByColumn="True"
    AllowPaging="True" AllowSorting="True" CellSpacing="0" GridLines="None"
    PageSize="500" ShowGroupPanel="True">
 <ClientSettings AllowDragToGroup="True">
 </ClientSettings>
 <MasterTableView AutoGenerateColumns="False" DataKeyNames="orderno"
 DataSourceID="SqlDataSource1" GroupsDefaultExpanded="False">
 <RowIndicatorColumn Visible="False">
 </RowIndicatorColumn>
 <ExpandCollapseColumn Created="True">
 </ExpandCollapseColumn>
 <Columns>
 <telerik:GridBoundColumn DataField="custnum" DataType="System.Decimal" FilterControlAltText="Filter custnum column"     HeaderText="Client Number" SortExpression="custnum" UniqueName="custnum">
 </telerik:GridBoundColumn>
 
 <telerik:GridBoundColumn DataField="event_date" DataType="System.DateTime" FilterControlAltText="Filter event_date column" HeaderText="Date" ReadOnly="True" SortExpression="event_date" UniqueName="event_date">
 </telerik:GridBoundColumn>
 
 <telerik:GridBoundColumn DataField="orderno" DataType="System.Decimal" FilterControlAltText="Filter orderno column"    HeaderText="Order Number" ReadOnly="True" SortExpression="orderno" UniqueName="orderno">
 </telerik:GridBoundColumn>
 
 <telerik:GridBoundColumn DataField="statdesc" FilterControlAltText="Filter statdesc column" HeaderText="Order Status" SortExpression="statdesc" UniqueName="statdesc">
 </telerik:GridBoundColumn>
 </Columns>
 <GroupByExpressions>
 <telerik:GridGroupByExpression>
 <SelectFields>
 <telerik:GridGroupByField FieldAlias="custnum" FieldName="custnum" HeaderText=" " HeaderValueSeparator="" />
 </SelectFields>
 <SelectFields>
 <telerik:GridGroupByField FieldAlias="event_date" FieldName="event_date" HeaderText=" " HeaderValueSeparator=" " />
 </SelectFields>
 <SelectFields>
 <telerik:GridGroupByField FieldAlias="orderno" FieldName="orderno" HeaderText=" " HeaderValueSeparator=" " />
 </SelectFields>
 <SelectFields>
 <telerik:GridGroupByField FieldAlias="statdesc" FieldName="statdesc" HeaderText=" " HeaderValueSeparator=" " />
 </SelectFields>
 <GroupByFields>
 <telerik:GridGroupByField FieldAlias="custnum" FieldName="custnum" FormatString="" HeaderText="" />
 </GroupByFields>
 </telerik:GridGroupByExpression>
 </GroupByExpressions>
 <PagerStyle AlwaysVisible="True" Mode="NextPrevNumericAndAdvanced" Position="TopAndBottom" />
 </MasterTableView>
 
 </telerik:RadGrid>
 </div>
 <br />
 <asp:SqlDataSource ID="SqlDataSource1" runat="server"
 ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
 SelectCommand="Report"
 SelectCommandType="StoredProcedure">
 </asp:SqlDataSource>
 
</asp:Content>

Princy
Top achievements
Rank 2
 answered on 19 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?