My script works fine, but I am not able to export .pdf file from a report generated. This is my code:
import arcpy inputFC = arcpy.GetParameterAsText(0) outputFC = arcpy.GetParameterAsText(1) matricula = arcpy.GetParameterAsText(2) query = """ "MATRICULA" LIKE '%s'""" %matricula arcpy.env.workspace = "C:/Prueba/arcpy" arcpy.MakeFeatureLayer_management(inputFC,"Tramos_LAT_layer") arcpy.SelectLayerByAttribute_management("Tramos_LAT_layer","NEW_SELECTION",query) arcpy.CopyFeatures_management("Tramos_LAT_layer",outputFC) # Following I try to export report from outputFC # RLF plantilla = "PLANTILLA_INFORMES.rlf" # PDF pdf = "zz_salida_report.pdf" # Exportamos Report arcpy.mapping.ExportReport(outputFC,plantilla,pdf)
I also tested another option, I created a layer file, but it didn´t work either:
lyr = arcpy.mapping.Layer(outputFC) arcpy.mapping.ExportReport(lyr,plantilla,pdf)
I have checked all post about this issue, although I don't understand why my script doesn't work.