I have a radgrid with an export function that brings data from a database, including an additional header and text, which are document conditions. These document conditions include images, the problem is the last image that is resized to adjust to the tall of the PDF
Protected Sub CotDetGrid_PdfExporting(sender As Object, e As GridPdfExportingArgs) Handles CotDetGrid.PdfExporting
Try
colwidth = Split(CamposDeseados, ",").Count
Dim columnasMenos = 0
If PoscProducto.Equals("Fila") Then
If CamposDeseados.Contains("Producto") And CamposDeseados.Contains("Observación") Then
colwidth -= 2
columnasMenos = 2
ElseIf CamposDeseados.Contains("Producto") Or CamposDeseados.Contains("Observación") Then
colwidth -= 1
columnasMenos = 1
End If
Else
If CamposDeseados.Contains("Observación") Then
colwidth -= 1
columnasMenos = 1
End If
End If
colwidth = CType((555 / colwidth), Integer) 'calcular el width segun la cantidad de columnas
e.RawHTML = ""
e.RawHTML = "<
div
style
=
'font-size:10pt;'
>" & _
"<
table
width
=
'555px'
style
=
' margin-left:0px; margin-right:0px;'
>" & _
"<
colgroup
><
col
/><
col
/></
colgroup
>" & _
"<
tbody
>" & _
"<
tr
>" & _
"<
td
align
=
'center'
colspan
=
'2'
> " + Imagen + "</
td
>" & _
"</
tr
>" & _
"<
tr
>" & _
"<
td
align
=
'center'
colspan
=
'2'
> " + DirTel + "</
td
>" & _
"</
tr
>" & _
"<
tr
>" & _
"<
td
align
=
'center'
colspan
=
'2'
> </
td
>" & _
"</
tr
>" & _
"<
tr
>" & _
"<
td
> </
td
>" & _
"<
td
align
=
'right'
>" + FechaElaboracion + "</
td
>" & _
"</
tr
>" & _
"<
tr
>" & _
"<
td
> </
td
>" & _
"<
td
align
=
'right'
>" + FechaEmision + "</
td
>" & _
"</
tr
>" & _
"<
tr
><
td
> </
td
><
td
> </
td
></
tr
>" & _
"<
tr
>" & _
"<
td
align
=
'left'
>" + Cliente + "</
td
>" & _
"<
td
align
=
'right'
>" + Moneda + "</
td
>" & _
"</
tr
>" & _
"<
tr
>" & _
"<
td
align
=
'left'
>" + Saludo + ContactoNombre + "</
td
>" & _
"<
td
align
=
'right'
>" + NumPartidas + "</
td
>" & _
"</
tr
>" & _
"<
tr
>" & _
"<
td
align
=
'left'
>" + ContactoPuesto + "</
td
>" & _
"<
td
align
=
'right'
>" + fFolio + "</
td
>" & _
"</
tr
>" & _
"<
tr
>" & _
"<
td
align
=
'left'
>" + ContactoTelefono + "</
td
>" & _
"<
td
> </
td
>" & _
"</
tr
>" & _
"<
tr
>" & _
"<
td
colspan
=
'2'
> </
td
>" & _
"</
tr
>" & _
"<
tr
style
=
'text-align: justify; text-justify: inter-word;'
>" & _
"<
td
colspan
=
'2'
> " + hiddenMensajeGrid.Value + " </
td
>" & _
"</
tr
>" & _
"</
tbody
>" & _
"</
table
>"
Dim columnasPdf As Integer = CamposDeseados.Split(",").Length - columnasMenos
Dim col = ""
For i = 1 To columnasPdf Step 1
col += "<
col
/>"
Next
e.RawHTML = Convert.ToString(e.RawHTML) & _
"<
table
width
=
'555px'
style
=
'font-size:8pt; margin-left:0px; margin-right:0px;white-space: nowrap;'
>" & _
"<
colgroup
>" & _
col & _
"</
colgroup
>" & _
"<
tbody
>" & _
"<
tr
style
=
'text-align:center; background-color:#A0A0A0; color:#FFFFFF; font-weight: bold;'
>"
If CamposDeseados.Contains("Partida") Then
e.RawHTML = Convert.ToString(e.RawHTML) & _
"<
td
>Partida</
td
>"
End If
If CamposDeseados.Contains("Imagen") Then
e.RawHTML = Convert.ToString(e.RawHTML) & _
"<
td
>Imagen</
td
>"
End If
If CamposDeseados.Contains("Código") Then
e.RawHTML = Convert.ToString(e.RawHTML) & _
"<
td
>Código</
td
>"
End If
If CamposDeseados.Contains("Producto") And PoscProducto.Equals("Columna") Then
e.RawHTML = Convert.ToString(e.RawHTML) & _
"<
td
>Producto</
td
>"
End If
If CamposDeseados.Contains("Unidad de Medida") Then
e.RawHTML = Convert.ToString(e.RawHTML) & _
"<
td
>Unidad de Medida</
td
>"
End If
If CamposDeseados.Contains("Precio Unitario") Then
e.RawHTML = Convert.ToString(e.RawHTML) & _
"<
td
style
=
'text-align:right;'
>Precio Unitario</
td
>"
End If
If CamposDeseados.Contains("Cantidad") Then
e.RawHTML = Convert.ToString(e.RawHTML) & _
"<
td
>Cantidad</
td
>"
End If
If CamposDeseados.Contains("Importe") Then
e.RawHTML = Convert.ToString(e.RawHTML) & _
"<
td
style
=
'text-align:right;'
>Importe</
td
>"
End If
If CamposDeseados.Contains("Descuento %") Then
e.RawHTML = Convert.ToString(e.RawHTML) & _
"<
td
style
=
'text-align:right;'
>Descuento %</
td
>"
End If
If CamposDeseados.Contains("Impuesto %") Then
e.RawHTML = Convert.ToString(e.RawHTML) & _
"<
td
style
=
'text-align:right;'
>Impuesto %</
td
>"
End If
If CamposDeseados.Contains("Impuesto") Then
e.RawHTML = Convert.ToString(e.RawHTML) & _
"<
td
style
=
'text-align:right;'
>Impuesto</
td
>"
End If
If CamposDeseados.Contains("Total") Then
e.RawHTML = Convert.ToString(e.RawHTML) & _
"<
td
style
=
'text-align:right;'
>Total</
td
>"
End If
e.RawHTML = Convert.ToString(e.RawHTML) & _
"</
tr
>" & _
body & _
"</
tbody
>" & _
"</
table
>" & _
"</
div
>"
e.RawHTML = Convert.ToString(e.RawHTML) & "<
br
/><
br
/><
br
/>"
e.RawHTML = Convert.ToString(e.RawHTML) & "<
div
style
=
'font-size:10pt;'
>"
e.RawHTML = Convert.ToString(e.RawHTML) & "<
table
width
=
'555px'
style
=
'margin-left:0px; margin-right:0px;'
>"
e.RawHTML = Convert.ToString(e.RawHTML) & "<
colgroup
><
col
/></
colgroup
>"
e.RawHTML = Convert.ToString(e.RawHTML) & "<
tbody
>"
If IncluirCondiciones = 1 Then
CotizacionCondiciones = CotizacionCondiciones.Replace("<
p
", "<div
style
=
'font-size:10pt;'
")
CotizacionCondiciones
= CotizacionCondiciones.Replace("</p>", "</
div
><
br
/><
p
></
p
>")
CotizacionCondiciones = CotizacionCondiciones.Replace("span", "div style='font-size:10pt;'")
e.RawHTML = Convert.ToString(e.RawHTML) & "<
tr
> <
td
style
=
'line-height:1;'
> <
p
></
p
>" + CotizacionCondiciones + "</
td
> </
tr
>"
End If
If IncluirFirma = 1 Then
e.RawHTML = Convert.ToString(e.RawHTML) & "<
tr
><
td
> </
td
></
tr
><
tr
><
td
> </
td
></
tr
><
tr
><
td
> </
td
></
tr
><
tr
><
td
style
=
'text-align:center'
>___________________________</
td
></
tr
><
tr
><
td
style
=
'text-align:center'
>" + NombreResponsable + "</
td
></
tr
>"
End If
e.RawHTML = Convert.ToString(e.RawHTML) & "</
tbody
>"
e.RawHTML = Convert.ToString(e.RawHTML) & "</
table
>"
e.RawHTML = Convert.ToString(e.RawHTML) & "</
div
>"
Catch ex As Exception
ErrorManager(ex, "CotDetGrid_PdfExporting")
End Try
End Sub
the HTML code of CotizacionCondiciones is:
<
p
>Montos mencionados son en Moneda Nacional.<
br
/>
Condiciones de Pago: Anticipo 70% y el resto del 30% al terminar nuestro trabajo.<
br
/>
<
br
/>
Ventajas de nuestros productos:<
br
/>
<
br
/>
Nuestro trabajo cuenta con garantía de 10 años a partir de la fecha de instalación, siempre y cuando no haya sido modificado por personal no certificado por nuestra empresa.<
br
/>
Material de alta calidad (aluminio con laca química al horno) importado de Europa.<
br
/>
Fabricados a la medida sin juntas ni soldaduras.<
br
/>
Fijaciones Ocultas.<
br
/>
Fabricamos en Sitio con equipo y tecnología Europea.<
br
/>
Sin mas por el momento y agradeciendo su atención a la presente, quedamos a sus ordenes para cualquier duda y/o aclaración sobre la presente en el siguiente correo: servicio@gutterkelmty.mx o directamente con un servidor<
br
/>
<
br
/>
Atentamente,<
br
/>
Jose L Salazar<
br
/>
<
p
><
img
alt
=
""
src
=
"/Imagenes/PlantillasDocumentos/des/1/screen.png"
style
=
"width: 555px; height: 313px; vertical-align: middle;"
/></
p
>
Hi,
We have a number of legacy applications, one which uses the 'Telerik Extensions for ASP.NET MVC' product (the version is from around 2013).
I believe this product is no longer supported by Telerik, but I'm interested in whether it would likely be impacted by the same issue as UI for ASP.NET Ajax.
Thanks
Hi Telerik team,
Is cryptographic vulnerability described at http://www.telerik.com/support/kb/aspnet-ajax/details/cryptographic-weakness?utm_medium=email
only applicable if we are using “Telerik.Web.UI.DialogHandler” control in our application ?
Thanks.
<Columns> <telerik:GridBoundColumn DataField="Question" HeaderText='<%#Eval("SubjectArea") %>' SortExpression="Question" UniqueName="ContactName"> |
</telerik:GridBoundColumn> |
</Columns> |
<Columns> |
<telerik:GridBoundColumn DataField="Question" HeaderText='<%#Bind("SubjectArea") %>' SortExpression="Question" |
UniqueName="ContactName"> |
</telerik:GridBoundColumn> </Columns> |
Hello !
Here is my situation:
I dynamically generate RadGrid from code behind (number of RadGrid, and their ID, is unknown before the page load, it depends of a database).
I have a unique PlaceHolder "Grids" (to insert my RadGrids), RadAjaxManager and RadAjaxLoadingPanel.
I create their ItemCommand and ajaxify each RadGrid basically as follow:
var grid =
new
RadGrid();
//...
grid.MasterTableView.CommandItemTemplate =
new
GridCommandItemTemplate();
Grids.Controls.Add(grid);
RadAjaxManager1.AjaxSettings.AddAjaxSetting(grid, grid, RadAjaxLoadingPanel1);
Now I'm trying to add a RadAsyncUpload. The purpose is that the user upload a file, which will be read server-side, insert some data in the database, and will rebind the grid displaying the newly added rows. Each grid can have its own upload button, therefore I think placing it in the GridCommandItemTemplate makes sense and is user friendly. I've added the RadAsyncUpload and so far so good.
However. When my postback is triggered, it's not ajaxified. My whole page is reload. I was expecting my RadAsyncUpload to behave like the other RadButtons of the GridCommandItemTemplate but it's not.
I have tried to ajaxify it during the Item_created event of my RadGrid but I get an error about the collection being modified.
Does someone have a solution ?
I have a RadGrid with some GridTemplateColumns. I have an ItemTemplate and EditItemTemplate. In the ItemTemplate I have an <asp:CheckBox>. On page load everything is fine (pic1), but when I add a new row client-side (no postback) using the following javascript function the new row does not show the CheckBox in the ItemTemplate. The column (look at "Analytical Method Required") looks blank (pic2). The EditItemTemplate appears to work...if I click the column on that row the checkbox appears and I can set it (pic3). Then when focus leaves the column the text "true" is displayed instead of the ItemTemplate's checkbox (pic4).
I have tried debugging in the javascript and can't seem to get a reference to the ItemTemplate's checkbox control (using row.findElement())...it returns null.
Anyone know how I can get the ItemTemplate's checkbox to be present when I add a new row client-side? Thanks.
JS:
function AddNewRowInGrid(sender, args) {
var grid = $find("<%= grdActivityType.ClientID %>");
var masterTable = grid.get_masterTableView();
grid.get_batchEditingManager().addNewRecord(masterTable); }
TemplateColumn:
<
telerik:GridTemplateColumn
DataField
=
"AnalyticalMethodRequired"
UniqueName
=
"AnalyticalMethodRequired"
HeaderText
=
"Analytical Method Required"
HeaderStyle-Width
=
"10%"
SortExpression
=
"IGNORE_CASE actyp_anl_mth_req_yn"
ItemStyle-VerticalAlign
=
"Top"
ItemStyle-HorizontalAlign
=
"Center"
HeaderStyle-HorizontalAlign
=
"Center"
>
<
ItemTemplate
>
<
asp:CheckBox
ID
=
"chkAnalyticalMethodRequiredItemTemplate"
runat
=
"server"
Checked='<%# Eval("AnalyticalMethodRequired") %>' onclick='checkBoxClicked(this, event);' />
</
ItemTemplate
>
<
EditItemTemplate
>
<
asp:CheckBox
ID
=
"chkAnalyticalMethodRequiredEditItemTemplate"
runat
=
"server"
Checked='<%# Bind("AnalyticalMethodRequired") %>' />
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
I have an ASPX page with a Master Page.
When I turn visibility on to a RadPane during initial page load it causes scrolling to occur (Scrolling="Both") it causes the dreaded unhandled exception at line 2545 of Telerik.Web.UI.WebResource.axd?
If I set the visibility via AJAX and postback it renders fine.
Any help would be appreciated. Thanks
Hello Support,
We have Telerik grid in our application
We are facing the problem of sorting for date field column It sort only for date and month field not for year field
we have set the autogenerated column is true and all columns are dynamically generated that are bound to grid
Please help us to resolve the problem
Thank you
Sandip
I have a filter dropdown as you can see in the attachment and my filter options are quite wide and they either drop to two lines or add a scrollbar which is not what I want.
I have tried adding FilterControlWidth="300px" to the GridBoundColumn in the definition of the RadGrid but it is being ignored.
What is the correct way of expanding the width of the filter dropdown?